Problem 2004
来源:互联网 发布:java开发人事管理系统 编辑:程序博客网 时间:2024/06/06 03:52
成绩转换
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 76335 Accepted Submission(s): 33532
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
====================================================================================================================================
我希望一段时间后一些很难得题目我都能像做这一道题目一样
#include <iostream>using namespace std;int main(){ int a; char b; while (cin >> a){ if (a>=0 && a<=100){ if (a>=60){ if (a>=80){ if (a>=90) b='A'; else b='B'; } else{ if (a>=70) b='C'; else b='D'; } } else b = 'E'; cout << b << endl; } else cout << "Score is error!" << endl; } return 0;}
0 0
- Problem 2004
- problem
- Problem
- problem
- Problem
- Problem
- Problem
- Problem
- Problem
- Problem
- problem
- Problem
- Problem
- Problem
- Problem
- Problem
- Problem
- Problem
- ACL管理:Access Control List
- shell的初始化
- 循环执行的例行性工作:crontab
- 系统启动的服务设置
- shell学习1--grep学习
- Problem 2004
- shell学习2--正则表达式
- shell学习3--sed流编辑器
- shell学习4--awk的基本使用
- shell学习5--awk的比较表达式
- shell学习6--awk的编程结构--变量
- 组合数学的学习
- shell学习7--awk的编程结构--BEGIN…
- shell学习8--awk中常用的内置函数