多重if MultipleIf.java

import java.util.*;
public class MultipleIf{
//多重if
public static void main(String[] args){
Scanner in=new Scanner(System.in);
System.out.println("请输入你成绩:");
int grade=in.nextInt();
/*if(grade>90){
System.out.println("优秀");
}
 
if(90>grade&&grade>80){
System.out.println("良好");
}
if(80>grade&&grade>60){
System.out.println("中等");
}
if(grade<60){
System.out.println("不及格");}
*/
 
if(grade>=90){
System.out.println("优秀");
}else if(grade>80){
System.out.println("良好");
}else if(grade>60){
System.out.println("中等");
}else if(grade<60){
System.out.println("不及格");
}else{
System.out.println("正在测试");}
 
}
}
posted @ 2014-07-05 23:51  穿越地平线  阅读(199)  评论(0编辑  收藏  举报