(hdu 简单题 128道)hdu 2004(if语句的基本使用)
来源:互联网 发布:php timestamp 格式化 编辑:程序博客网 时间:2024/06/06 02:40
题目:
成绩转换
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 89231 Accepted Submission(s): 39335
Problem Description
输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下:
90~100为A;
80~89为B;
70~79为C;
60~69为D;
0~59为E;
90~100为A;
80~89为B;
70~79为C;
60~69为D;
0~59为E;
Input
输入数据有多组,每组占一行,由一个整数组成。
Output
对于每组输入数据,输出一行。如果输入数据不在0~100范围内,请输出一行:“Score is error!”。
Sample Input
5667100123
Sample Output
EDAScore is error!
Author
lcy
Source
C语言程序设计练习(一)
Recommend
JGShining | We have carefully selected several similar problems for you: 2002 2000 2010 2009 2013
题目分析:
简单题。
代码如下:
/* * f.cpp * * Created on: 2015年3月20日 * Author: Administrator hdu 2004 */#include <iostream>#include <cstdio>using namespace std;int main(){int score;while(scanf("%d",&score)!=EOF){if(score>= 90 && score <= 100){printf("A");}else if(score >= 80 && score <= 89){printf("B");}else if(score >= 70 && score <= 79){printf("C");}else if(score >= 60 && score <= 69){printf("D");}else if(score >= 0 && score <= 59){printf("E");}else{printf("Score is error!");}printf("\n");}return 0;}
1 0
- (hdu 简单题 128道)hdu 2004(if语句的基本使用)
- if语句的简单使用
- 使用if语句的简单代码
- if..else 语句的简单使用
- if语句的使用
- if语句的使用
- if语句的使用
- 看似简单的if语句
- Python中if语句的说明和简单使用实例
- (hdu 简单题 128道)hdu 2003 求绝对值
- Oracle IF语句的使用
- oracle if 语句的使用
- if语句的使用例子
- if else语句的使用
- mysql语句中用if的基本用法
- (hdu 简单题 128道)hdu 2001 计算两点间的距离
- iOS基础知识:if 语句以及if语句的使用注意事项
- 基本if分支语句
- vb.net机房收费系统重构——反射加七层登陆
- 求圆面积,圆周长,圆球表面积,圆球体积,圆柱体体积
- SQL Server优化的方法
- Android布局LinearLayout的嵌套使用
- 8.String to Integer (atoi)
- (hdu 简单题 128道)hdu 2004(if语句的基本使用)
- android 带旋转动画的饼图
- Linux内核源代码情景分析-nanosleep()和pause()
- 撒旦法但是发水电费水电费水电费
- 约瑟夫环问题两解
- Eclipse中文注释乱码解决
- 如何做微商?方法和技巧
- 紐巴倫999 bkbe rzay cfba
- ShellListView切换PopMenu的具体操作方法