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("什么也没有"); } } } }
相关文章推荐
- Linxu Shell 学习笔记(八)-- if else 与 case esac语句
- VS 复习,if...else if..else 和if..else的嵌套学习
- JavaScript基础学习笔记(三)——JavaScript 比较和逻辑运算符、JavaScript If...Else 语句、JavaScript Switch 语句
- if else switch 学生成绩 学习笔记
- 大型机学习之具体技术之-JCL练习(七)-IF/THEN/ELSE/ENDIF结构及嵌套条件分支结构
- 工作流学习笔记-ifElse活动;从工作流中取出返回值;计算器实例
- 学习笔记第五周——嵌套if语句之排位大小
- Keras深度学习框架学习笔记(3) - AttributeError:’module’ object has no attribute ‘ifelse’错误信息的解决方法
- Python学习笔记(4)——控制流If-else
- if else学习笔记
- [原创]java WEB学习笔记61:Struts2学习之路--通用标签 property,uri,param,set,push,if-else,itertor,sort,date,a标签等
- [汇编学习笔记]if/else,while,for,switch in Assembly Language
- JavaScript学习笔记15-if-else语句
- 学习笔记第四周——嵌套if语句之计算价钱
- Objective-C学习笔记(七)——if-else条件判断语句
- 使用if-else实现简单的登录注销(学习笔记)
- VS2010 学习笔记 WF4 (7) 学习If/Else逻辑节点,根据输入参数的长度来返回不同的问候语
- 编程基本功——嵌套if-else语句的妙用
- SHELL学习笔记----IF条件判断,判断条件
- linux shell学习笔记5( 条件判断:test,[],(),if/then )