public class demo_05 {
public static void main(String[] args) {
int score=20;
if (score>=90&&score<=100) { //成绩为90-100
System.out.println("成绩等级为S");
}
else if (score>=80&&score<90) { //成绩为80-90
System.out.println("成绩等级为A");
}
else if (score>=70&&score<80) { //成绩为70-80
System.out.println("成绩等级为B");
}
else if (score>=60&&score<70) { //成绩为60-70
System.out.println("成绩等级为C");
}
else if (score>=0&&score<60) { //成绩为0-60
System.out.println("成绩等级为D");
}
else { //其他成绩输出无效
System.out.println("成绩无效");
}
}
}