大佬们怎么做呀?[face]monkey2:019.png[/face] 定义数组,存储10个学生的考试成绩68、76、57、66、86、98、72、84、92、95,输出判断等级。 90~100 优秀 80~89 好 70~79 良 60~69 及格 60以下 不及格
public static void main(String[] args) {
int scores[] = new int[]{68,76,57,66,86,98,72,84,92,95};
for (int i =0;i < scores.length;i++){
int score = scores[i];
if(score >= 90){
System.out.println("优秀");
}
if(score >= 80){
System.out.println("好");
}
if(score >= 70){
System.out.println("良");
}
if(score >= 60){
System.out.println("及格");
}
if(score < 60){
System.out.println("不及格");
}
}