CoreJava/exp1/Score.java
2024-05-09 09:10:51 +08:00

28 lines
770 B
Java

package exp1;
import java.util.Scanner;
public class Score {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.print("请输入百分制成绩: ");
int score = scan.nextInt();
scan.close();
if(score>100 || score<0){
System.out.println("输入错误");
}else if(score>=90 && score<=100){
System.out.println("优秀");
}else if(score>=80 && score<90){
System.out.println("良好");
}else if(score>=70 && score<80){
System.out.println("中等");
}else if(score>=60 && score<70){
System.out.println("及格");
}else{
System.out.println("不及格");
}
}
}