#include #include #include

using namespace std;

struct Student { string name; int averageScore; int evaluationScore; bool isCadre; bool isWesternProvince; int paperNum; };

int main() { int N; cin >> N; vector students(N); for (int i = 0; i < N; i++) { cin >> students[i].name >> students[i].averageScore >> students[i].evaluationScore; char isCadre, isWesternProvince; cin >> isCadre >> isWesternProvince >> students[i].paperNum; students[i].isCadre = (isCadre == 'Y'); students[i].isWesternProvince = (isWesternProvince == 'Y'); }

int maxTotalPrize = 0;
string maxTotalPrizeName;
int totalPrize = 0;

for (int i = 0; i < N; i++) {
    int total = 0;
    if (students[i].averageScore > 80 && students[i].paperNum >= 1) {
        total += 8000;
    }
    if (students[i].averageScore > 85 && students[i].evaluationScore > 80) {
        total += 4000;
    }
    if (students[i].averageScore > 90) {
        total += 2000;
    }
    if (students[i].averageScore > 85 && students[i].isWesternProvince) {
        total += 1000;
    }
    if (students[i].evaluationScore > 80 && students[i].isCadre) {
        total += 850;
    }
    
    if (total > maxTotalPrize) {
        maxTotalPrize = total;
        maxTotalPrizeName = students[i].name;
    }
    
    totalPrize += total;
}

cout << maxTotalPrizeName << endl;
cout << maxTotalPrize << endl;
cout << totalPrize << endl;

return 0;

原文地址: https://www.cveoy.top/t/topic/iQFq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录