90分以上为’A’,80~89 分为’B’,70~79 分为’C’,60~69 分为’D’,60 分以下为’E’。
请输入成绩:67
请输入成绩:89
请输入成绩:56
D
B
E
package Diablo.day2; import java.util.Scanner; public class _09_cengji { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int x=scan.nextInt(); if (x>=0 && x<=100) { if (x >= 90) { System.out.println("A"); }else if (x<=89 && x>=80){ System.out.println("B"); }else if (x<=79 && x>=70){ System.out.println("C"); }else if (x<=69 && x>=60){ System.out.println("D"); }else { System.out.println("E"); } }else{ System.out.println("错误"); } } }