多数据输入
输入样例:
1
61
102
输出样例:
E
D
error!
代码:
#include <iostream>
using namespace std;
int main()
{
int score;
while(cin>>score){
if(score<0||score>100)
cout<<"error!"<<endl;
else
switch(score/10)
{
case 10:
case 9:cout<<"A"<<endl;continue;
case 8:cout<<"B"<<endl;continue;
case 7:cout<<"C"<<endl;continue;
case 6:cout<<"D"<<endl;continue;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:cout<<"E"<<endl;continue;
return 0;
}
}
}
新手勿喷