打印分数---循环switch
来源:互联网 发布:马尔可夫 python 编辑:程序博客网 时间:2024/05/16 19:34
import java.util.Scanner;
public class Mark {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入分数:");
Scanner sc = new Scanner(System.in);
int mark = sc.nextInt();
if (mark > 100 || mark < 0) {
System.out.println("该数不存在!!");
} else
switch (mark / 10) {
case 10:
System.out.println("A");
break;
case 9:
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
System.out.println("C");
break;
case 6:
System.out.println("D");
break;
default:
System.out.println("E");
break;
}
}
}
public class Mark {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入分数:");
Scanner sc = new Scanner(System.in);
int mark = sc.nextInt();
if (mark > 100 || mark < 0) {
System.out.println("该数不存在!!");
} else
switch (mark / 10) {
case 10:
System.out.println("A");
break;
case 9:
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
System.out.println("C");
break;
case 6:
System.out.println("D");
break;
default:
System.out.println("E");
break;
}
}
}
0 0
- 打印分数---循环switch
- 打印分数
- 用switch语句,根据成绩登记打印成绩分数范围,允许使用大小写
- switch循环
- switch循环
- 用switch输出分数等级
- switch循环的default
- javascript switch循环
- switch语句输出百分制的分数段
- switch开关语句,打印case消息,放进for循环,Java编程思想第四章练习8答案
- switch循环里的break
- java switch 多循环篇
- continue switch外的循环
- while switch break退出循环
- C++ for和switch循环
- C#实现简单switch循环
- if,switch,for循环语句
- C语言之 switch循环
- 各种杂项组件(4)之----SearchView(搜索框)、TabHost(选项卡)、ScrollView(滚动视图)
- IOS之Objective-C学习笔记(七)
- 一个我自己写的矩阵快速幂模板
- Python爬虫入门 《下》
- SOAP消息机制简介
- 打印分数---循环switch
- 黑马程序员之String类
- HDU1712 分组背包
- 单例设计模式
- 系统登录
- TP 框架中 获取变量 I()方法
- Android添加半透明操作提示的方法
- 安卓学习之路(一)
- 电话本