赞
踩
import java.util.Scanner;
import java.util.Random;
public class three {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
float sum=0;
int i=0;
int student[];
student=new int[100];
do{
int grade=input.nextInt();
student[i]=grade;
sum+=student[i];
i++;
}while(student[i-1]!=101);
float avg=(sum-101)/(i-1);
int count=0;
System.out.println("高于平均分的学生成绩有:");
for(int j=0;j<=i-2;j++) {
if(student[j]>avg) {
count++;
System.out.println(student[j]);
}
}
System.out.println("高于平均分的学生人数为:"+count);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。