Java-数组 求最大最小平均值
int[] array = {9,3,4,6,8,28,15,33};
int max = array[0];
for(int x:array){
if (x>=max){
max = x;
}
}
System.out.println(max);
int min = array[0];
for (int j:array){
if (j<=min){
min = j;
}
}
System.out.println(min);
double sum = 0.0;
for (int y:array){
sum = sum + y;
}
System.out.println(sum/array.length);