import java.util.*;
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan=new Scanner(System.in);
int[] arr=new int[10];
int sum=0;
int count=0;
System.out.println("请输入数字");
for(int i=0;i<n;i++) {
arr[i]=scan.nextInt();
sum+=arr[i];
}
int ave=sum/10;
System.out.println("平均值为:"+ave);
for(int i=0;i<n;i++) {
if(arr[i]>ave) {
count++;
System.out.println(arr[i]);
}
continue;
}
System.out.println(count);
}
}
请问这个代码哪里有错误,难道答案是唯一的吗?
2021-04-22 11:20:44