public class GetGrade2 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("请输入成绩:");
int grade=input.nextInt();
if(grade<=100&&grade>=0)
{
if(grade>=90)
{
System.out.println("A");
}
else if(grade>=80)
{
System.out.println("B");
}
else if(grade>=70)
{
System.out.println("C");
}
else if(grade>=60) {
System.out.println("D");
}
else
{
System.out.println("E");
}
}
else
{
System.out.println("分数"+grade+"有误 ");
}
}
} |