123jgh

导航

 
import java.util.Scanner;

public class Demo01 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.println("请输入成绩:");
int score = scanner.nextInt();

//equals:判断字符串是否相等
/*
String s = scanner.nextLine();
if(s.equals("hello")){}
*/

if (score==100){
System.out.println("满分");
}else if (score<100 && score>80){
System.out.println("A");
}else if (score<80 && score>60){
System.out.println("B");
}else if (score<60 && score>=0){
System.out.println("不及格");
}else{
System.out.println("成绩不合法");
}
scanner.close();
}
}
posted on 2022-10-12 16:35  江江要努力  阅读(28)  评论(0)    收藏  举报