public static void main(String[] args) {
// TODO Auto-generated method stub
int[] a={2,5,9};
int num=a[0];
for (int i = 0; i < a.length; i++) {
if (a[i]>num) {
num=a[i];
}
}
System.out.println("最大值:"+num);
for (int i = 0; i < a.length; i++) {
if (a[i]<num) {
num=a[i];
}
}
System.out.println("最小值:"+num);
}im