类似这样:
#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
switch (a/10)
{
case 10:
case 9:
cout << "等级:A" << endl;
break;
case 8:
cout << "等级:B" << endl;
break;
case 7:
cout << "等级:C" << endl;
break;
case 6:
cout << "等级:D" << endl;
break;
default:
cout << "输入的成绩有误!" << endl;
break;
}
return 0;
}