成绩转换
#include<stdio.h> void fun(int x ) { int i; i=x/10; switch(i) { case 10:printf(x>100?"Score is error!\n":"A\n");break; case 9: puts("A");break; case 8: puts("B");break; case 7: puts("C");break; case 6: puts("D");break; case 5: case 4: case 3: case 2: case 1: case 0:printf(x<0?"Score is error!\n":"E\n");;break; default :printf("Score is error!\n");break; } } int main( ) { int N; while(scanf("%d",&N)!=EOF) fun(N); return 0; } 刚开始提交时wrong answer悲剧啊。。立哥告诉我,-9/10后为0…原来是错在这。。。。。
posted on 2011-04-28 11:28 more think, more gains 阅读(160) 评论(0) 编辑 收藏 举报