成绩转换
思路:提前设好数组char a[] = "EEEEEEDCBAA";计算成绩%10,看看是什么成绩
代码:
#include<iostream> using namespace std; int main() { char a[] = "EEEEEEDCBAA"; int num; while (cin >> num) { if (num > 100||num<0) { cout << "Score is error!" << endl; } else{ cout << a[num/10] << endl; } } system("pause"); return 0; }