[java]代码库
import java.util.*;;
public class Example2_10 {
public static void main(String[] args) {
// TODO Auto-generated method stub
float score;
Scanner in=new Scanner (System.in);
System.out.print("请输入分数:");
score=in.nextFloat();
/*if(score<90)
if(score<80)
if(score<70)
if(score<60)
System.out.println("该同学的分数等级为:不及格");
else
System.out.println("该同学的分数等级为:及格");
else
System.out.println("该同学的分数等级为:中等");
else
System.out.println("该同学的分数等级为:良好");
else
System.out.println("该同学的分数等级为:优秀");*/
if(score >90){
System.out.println("该同学的分数为:优秀 ");
}else if(score >80){
System.out.println("该同学的分数为:良好");
}else if(score >70){
System.out.println("该同学的分数为:中等");
}else if(score >=60){
System.out.println("该同学的分数为:及格");
}else if(score <60){
System.out.println("该同学的分数为:不及格");
}
}
}