成績轉換
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 90024 Accepted Submission(s): 39714
Problem Description
輸入一個百分制的成績t,將其轉換成對應的等級,具體轉換規則如下:
90~100為A;
80~89為B;
70~79為C;
60~69為D;
0~59為E;
Input
輸入數據有多組,每組占一行,由一個整數組成。
Output
對於每組輸入數據,輸出一行。如果輸入數據不在0~100范圍內,請輸出一行:“Score is error!”。
Sample Input
56
67
100
123
Sample Output
E
D
A
Score is error!
Author
lcy
Source
C語言程序設計練習(一)
#include<stdio.h>
int main()
{
int a;
while(scanf("%d",&a)!=EOF)
{
if(a>=0&&a<=100)
{
if(a>=90)
printf("A\n");
else if(a>=80)
printf("B\n");
else if(a>=70)
printf("C\n");
else if(a>=60)
printf("D\n");
else if(a>=0)
printf("E\n");
}
else
printf("Score is error!\n") ;
}
return 0;
}