class IfTest
{
public static void main(String[] args)
{
int score = 59;
String level;
if (score>=90 && score<=100)
{
level = "A等";
}
else if (score>=80 && score<90)
{
level = "B等";
}
else if (score>=70 && score<=80)
{
level = "C等";
}
else if (score>=60 && score<=70)
{
level = "D等";
}
else if (score>=0 && score<60)
{
level = "E等";
}
else
{
level = "分数输入有误";
}
System.out.println("成绩:"+score+"------"+level);
}
}
|