switch-case练习
来源:互联网 发布:国家广电网络组织架构 编辑:程序博客网 时间:2024/06/01 23:07
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title></title></head><body><script> var month=prompt('请输入第一个月份'); var r=''; switch (month){ case '1': case '2': case '3': r='第1个季度'; break; case '4': case '5': case '6': r='第2个季度'; break; case '7': case '8': case '9': r='第3个季度'; break; case '10': case '11': case '12': r='第4个季度'; break; default : r='不符合条件'; } alert(r)</script></body></html>//if-else更适合于条件范围的判断,而switch-case只是用于条件可能性的判断
阅读全文
0 0
- switch-case练习
- switch-case练习
- switch..case
- switch case
- switch case
- switch-case
- switch-case
- switch-case
- switch-case
- switch case
- switch case
- Switch case
- switch ....case
- switch...case
- switch...case...
- switch case
- switch-case
- switch...case
- win32学习10.菜单
- Python学习练习1---直接上手编程
- 使用优先级队列广搜还是使用队列广搜
- PHP中ResultSet取字段值
- python -- 异常处理
- switch-case练习
- 交叉验证与网格搜索
- EOJ——Problem #3215——奶牛优惠券
- bzoj 1875 [SDOI2009]HH去散步
- AdaBoost算法笔记
- 核心语言对象String、Math和Data对象
- js基础---函数传参 数组基础
- Java本地文件(File类的操作)
- 交叉验证与网格搜索