Bestcoder Pro.ID 2004 成绩转换
来源:互联网 发布:网络语高达是什么意思 编辑:程序博客网 时间:2024/05/21 14:02
import java.util.Scanner;/** * * @solution : 输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下: 90~100为A; 80~89为B; 70~79为C; * 60~69为D; 0~59为E; * @input : 输入数据有多组,每组占一行,由一个整数组成。 * @output : 对于每组输入数据,输出一行。如果输入数据不在0~100范围内,请输出一行:“Score is error!”。 * * @discription com.acmcoder.acm.ProblemID2004.Main.java * @author wuyanhui * @date Apr 22, 2016 -- 3:18:05 PM */public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);int inputInt;char outChar = 'A';while (in.hasNext()) {try {inputInt = in.nextInt();} catch (Exception e) {System.out.println("Score is error!");// 非Intin.next();continue ;}if (inputInt < 0 || inputInt > 100) {System.out.println("Score is error!");// 非Int} else {switch (inputInt / 10) {case 10:case 9:outChar = 'A';break;case 8:outChar = 'B';break;case 7:outChar = 'C';break;case 6:outChar = 'D';break;default: outChar = 'E';break;}System.out.println(outChar);}}in.close();}}
0 0
- Bestcoder Pro.ID 2004 成绩转换
- Bestcoder Pro.ID 2003 求绝对值
- Bestcoder Pro.ID 2002 计算球体积
- Bestcoder Pro.ID 2010 水仙花数
- Bestcoder Pro.ID 2005 第几天?
- Bestcoder Pro.ID 2008 数值统计
- Bestcoder Pro.ID 2011 多项式求和
- Bestcoder Pro.ID 2012 素数判定
- Bestcoder Pro.ID 2013 蟠桃记
- Bestcoder Pro.ID 2017 字符串统计
- 南阳ID:98 成绩转换
- Bestcoder Pro.ID 2006 求奇数的乘积
- Bestcoder Pro.ID 2007 平方和与立方和
- Bestcoder Pro.ID 2009 求数列的和
- hdu 2004 成绩转换
- HUD 2004 成绩转换
- 2004 成绩转换
- 2004 成绩转换
- Android资源代码 源码 整理 Github开源项目下载地址
- 启动Thread、调用Handler
- Mongodb连接详解
- 利用STL中的队列queue对二叉树进行层遍历
- curl应用总结(三)
- Bestcoder Pro.ID 2004 成绩转换
- Maven (Eclipse版)
- Mac 下安装 MySql
- echarts 地图 热点 统计图
- hbase的thrift接口
- Apache端口映射
- 微软推荐您完成Windows 10 的免费升级
- STM32问题锦集
- 如何用Maven创建web项目(具体步骤)