1913: 成绩评估

1913: 成绩评估

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 1398  Solved: 575
[Submit][Status][Web Board]

Description

我们知道,高中会考是按等级来的。 90~100为A; 80~89为B; 70~79 为C; 60~69为D; 0~59为E。 编写一个程序,对输入的一个百分制的成绩t,将其转换成对应的等级。

Input

输入数据有多组,每组占一行,由一个整数组成。

Output

对于每组输入数据,输出一行。如果输入数据不在0~100范围内,请输出一行:“Score is error!”。

Sample Input

56
67
100
123

Sample Output

E
D
A
Score is error!
#include<stdio.h>
int main()
{
    int m,n;
    char c;
    while(scanf("%d",&n)!=EOF)
    {
        if(n>=0&&n<=100)
        {
        switch(n/10)
        {
        case 10:
        case 9:
        printf("A\n");
        break;
        case 8:
        printf("B\n");
        break;
        case 7:
        printf("C\n");
        break;
        case 6:
        printf("D\n");
        break;
        default:
        printf("E\n");
        }
        }
        else
        printf("Score is error!\n");
    }
}

  千万不要忘记break!!!

 
posted @ 2018-04-01 20:32  青衫客36  阅读(263)  评论(0编辑  收藏  举报