import java.util.Scanner;
public class Test {
public static void main(String[] args) {
System.out.println("————————成绩等级评价系统————————");
System.out.println("1、满分;");
System.out.println("2、优秀;");
System.out.println("3、良好;");
System.out.println("4、一般;");
System.out.println("5、及格;");
System.out.println("6、补考;");
Scanner input=new Scanner(System.in);
System.out.println("请输入你的成绩(0~100):" );
int score=input.nextInt();
while(score<0|score>100){
System.out.println("输入有误!");
System.out.println("请再次输入你的成绩(0~100):" );
score=input.nextInt();
}
switch (score/10){
case 10:
System.out.println("满分");
break;
case 9:
System.out.println("优秀");
break;
case 8:
System.out.println("良好");
break;
case 7:
System.out.println("一般");
break;
case 6:
System.out.println("及格");
break;
default:
System.out.println("补考");
break;
}
}
}
转载于:https://blog.51cto.com/xiaobinge/1251197