2004 成绩转换

#include<cstdio>
#include<iostream>

using namespace std;

int main() {
    int score;
    while (cin >> score) {
        if (score > 100 || score < 0) {
            printf("Score is error!\n");
        }
        else if (score >= 90) {
            printf("A\n");
        }
        else if (score >= 80) {
            printf("B\n");
        }
        else if (score >= 70) {
            printf("C\n");
        }
        else if (score >= 60) {
            printf("D\n");
        }
        else {
            printf("E\n");
        }
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/Mered1th/p/10556035.html