您的位置:首页 > 其它

if else 嵌套学习笔记

2015-01-07 14:47 351 查看
import java.util.Scanner;
class TestIf3 {
public static void main(String[] args) {

Scanner s =new Scanner(System.in);
System.out.println("请输入小明的期末成绩:(分)");
int score=s.nextInt();
if(score>100||score<0){
System.out.println("你输入的数值有误");
}else{
if(score==100){
System.out.println("奖励一辆BMW");

}else if(score>=80&&score<=99){
System.out.println("奖励一台iphone5s");

}else if(score>=60&&score<=80){
System.out.println("奖励一本参考书");

}else{
System.out.println("什么也没有");
}
}

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  import public 期末成绩