public class Task01{
public static void main(String[] args) {
// 声明部分
int score;
String level;
Scanner sc = new Scanner(System.in);
// 输入部分
System.out.print("score = ");
score = sc.nextInt();
// 处理部分
level = "";
if (score > 100) {
level = "超出范围";
} else if (score >= 90) {
level = "优秀";
} else if (score >= 80) {
level = "良好";
} else if (score >= 70) {
level = "中等";
} else if (score >= 60) {
level = "及格";
} else if (score >= 0) {
level = "不及格";
} else {
level = "超出范围";
}
// 输出部分
System.out.println(level);
}
结果