double sum=0;//用接收每个班级的总分
int pass=0;//接收几个的人数
for (int j = 1; j <= 3; j++) {
for (int i=1;i<6;i++){
System.out.println("请输入"+j+"班第"+i+"个同学的成绩");
double soure=scanner.nextInt();
if (soure>=60){
pass++;
}
System.out.println("成绩是"+soure);
sum+=soure;
}
System.out.println(j+"班总分"+sum+"平均分"+(sum/5));
}
System.out.print("及格人数"+pass);
02-25
1万+
03-26
428