HDU 2004 成績轉換

淡定的小魚發表於2014-07-29

成績轉換

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 73988    Accepted Submission(s): 32510


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!
 


不讓我過是吧!是你逼我的,不要怪我不則手段,是你先噁心我的


#include<stdio.h>
int  main()
{
	int n;
	while(~scanf("%d",&n)) 
	{
		switch(n)
		{
			case 0:
			case 1:
			case 2:
			case 3:
			case 4:	
			case 5:	
			case 6:	
			case 7:	
			case 8:	
			case 9:	
			case 10:
			case 11:
			case 12:
			case 13:
			case 14:	
			case 15:	
			case 16:	
			case 17:	
			case 18:	
			case 19:
			case 20:
			case 21:
			case 22:
			case 23:
			case 24:	
			case 25:	
			case 26:	
			case 27:	
			case 28:	
			case 29:
			case 30:
			case 31:
			case 32:
			case 33:
			case 34:	
			case 35:	
			case 36:	
			case 37:	
			case 38:	
			case 39:
			case 40:
			case 41:
			case 42:
			case 43:
			case 44:	
			case 45:	
			case 46:	
			case 47:	
			case 48:	
			case 49:
			case 50:
			case 51:
			case 52:
			case 53:
			case 54:	
			case 55:	
			case 56:	
			case 57:	
			case 58:	
			case 59:printf("E\n");break;
			case 60:
			case 61:
			case 62:
			case 63:
			case 64:	
			case 65:	
			case 66:	
			case 67:	
			case 68:	
			case 69:printf("D\n");break;
			case 70:
			case 71:
			case 72:
			case 73:
			case 74:	
			case 75:	
			case 76:	
			case 77:	
			case 78:	
			case 79:printf("C\n");break;
			case 80:
			case 81:
			case 82:
			case 83:
			case 84:	
			case 85:	
			case 86:	
			case 87:	
			case 88:	
			case 89:printf("B\n");break;
			case 90:
			case 91:
			case 92:
			case 93:
			case 94:	
			case 95:	
			case 96:	
			case 97:	
			case 98:	
			case 99:
			case 100:printf("A\n");break;
			default :printf("Score is error!\n");	
		}
	}
	return 0;
}



相關文章