import java.util.Scanner;
class Demo
{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("请输入数据");
int score = sc.nextInt();
String level = " ";
if (score >= 90 && score <=100)
{
level = "A等";
}
else if (score >= 80 && score <=89)
{
level = "B等";
}
else if (score >= 70 && score <=79)
{
level = "C等";
}
else if (score >= 60 && score <=69)
{
level = "D等";
}
else if (score >= 0 && score <=59)
{
level = "E等";
}
else
{
level = "数据输入错误";
}
System.out.println("level = "+level);
}
} |
|