成绩转换
时间:2014-04-29 09:38:47
收藏:0
阅读:409
#include<iostream> using namespace std; int main() { int N; //测试数据组数 cin>>N; while(N--) { int M; //百分制成绩 cin>>M; int a=M/10; switch(a) { case 9: case 10: cout<<"A"<<endl;break; case 8: cout<<"B"<<endl;break; case 7: cout<<"C"<<endl;break; case 6: cout<<"D"<<endl;break; case 5: case 4: case 3: case 2: case 1: case 0: cout<<"E"<<endl;break; default: cout<<"error"<<endl; } } return 0; }
评论(0)