成绩转换

时间:2014-04-29 09:38:47   收藏:0   阅读:409

 

mamicode.com,码迷
#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;
}
mamicode.com,码迷

 

 

 

成绩转换,码迷,mamicode.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!