输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下:
90~100为A;
80~89为B;
70~79为C;
60~69为D;
0~59为E;
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
if (n>=90&&n<=100)
{
cout << "A" << endl;
}
else if (n>=80&&n<=89)
{
cout << "B" << endl;
}
else if (n >= 70 &&n <= 79)
{
cout << "C" << endl;
}
else if (n >= 60 &&n <= 69)
{
cout << "D" << endl;
}
else if (n>=0&&n<=59)
{
cout << "E" << endl;
}
else
{
cout << "Score is error!" << endl;
}
}
return 0;
}