import java.util.Scanner;
public class Test {
public static void main(String[] args) {
//学生成绩管理系统
int student;//控制学生的变量
double sum=0,avg=0; //总成绩和平均成绩
double[] temp=new double[10];
//创建一个Scanner类的对象,用它来获得用户的输入
Scanner sc=new Scanner(System.in);
System.out.println("请输入前10名的成绩");
for(student=0;student<temp.length;student++) {
//读取用户的输入
temp[student]=sc.nextDouble();
sum+=temp[student];
}
avg=sum/10;
System.out.println("平均值是:"+avg);
for(student=0;student<temp.length;student++) {
if(temp[student]<avg) {
System.out.println("该学生的成绩低于平均成绩");
}else if(temp[student]>avg) {
System.out.println("该学生的成绩高于平均成绩");
}else {
System.out.println("该学生的成绩等于平均成绩");
}
}
}
}