import java.util.Scanner;
class Main {
public static void main(String[] args) {
int max=0,min=0,a=0;
float aver=0.0f,sum = 0.0f;
Scanner sc = new Scanner(System.in);
int arr[] = new int[10];
int brr[] = new int[10];
for (int i = 0; i < arr.length; i++) {
arr[i] = sc.nextInt();
}
max = arr[0];
for (int i = 0; i < arr.length ; i++) {
if(max<arr[i])
max = arr[i];
}
min = arr[0];
for (int j = 0; j < arr.length ; j++) {
if(min>arr[j])
min = arr[j];
}
for (int i = 0; i < arr.length; i++) {
if(arr[i] % 2 == 0) {
brr[i] = arr[i];
a++;
}
}
for (int i = 0; i < 10; i++) {
sum = sum+(float)brr[i];
}
aver = sum / a;
System.out.println("最大值是"+max);
System.out.println("最小值是"+min);
System.out.println("偶数的个数是"+a);
System.out.println("偶数的平均值是"+aver);
}
}
如何修改?