数组平均值,最大值,最小值
package cao;
public class fuck {
public static void main(String[] args) {
int[] a = { 38, 666, 74, 250, 62, 99, 20 };
int min, max;
min = max = a[0];
double sum = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] > max) {
max = a[i];
}
if (a[i] < min) {
min = a[i];
}
sum += a[i];
}
System.out.println(max);
System.out.println(min);
System.out.println(sum / a.length);
}
}