hduoj 2004
来源:互联网 发布:阿里云主机记录 编辑:程序博客网 时间:2024/06/14 16:25
成绩转换
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!
#include<stdio.h>
int main()
{
int t;
while(scanf("%d\n",&t)!=EOF)
{
if(t<0||t>100){
printf("Score is error!\n");
}else{
if(t>=0&&t<60){
printf("E\n");
}
if(t>=60&&t<70){
printf("D\n");
}
if(t>=70&&t<80){
printf("C\n");
}
if(t>=80&&t<90){
printf("B\n");
}
if(t>=90&&t<=100){
printf("A\n");
}
}
}
return 0;
}
阅读全文
0 0
- hduoj 2004
- HDUOJ
- HDUoj
- HDUOJ 2050
- HDUOJ 2018
- HDUOJ 2069
- HDUOJ 1303
- HDUOJ 2031
- HDUOJ 2047
- HDUOJ 2089
- hduoj 1708
- hduoj 2031
- hduoj 2032
- hduoj 1062
- HDUOJ 1039
- HDUOJ lines
- HDUOJ入门
- HDUOJ 水果
- Hibernate 映射关系(基于注解)
- Andorid应用去google广告
- 华为服务器远程iMana(IPMI)使用的一些问题
- log4j 和log4j2配置差异
- sql server 导出 image到文件
- hduoj 2004
- springboot学习笔记--Spring Boot使用数据库(MySQL)
- 详解KMP算法
- java生成二维码图片(有logo),并在图片下方附文字
- java中的I/O模型
- Install OpenCV dependencies on Ubuntu 16.04 with python2 and python3
- PHP操作Excel – PHPExcel 基本用法详解
- MT4 Series array
- 解决JsonFormat日期少一天问题