其他分享
首页 > 其他分享> > P5742 【深基7.例11】评等级

P5742 【深基7.例11】评等级

作者:互联网

题目传送门

#include <bits/stdc++.h>

using namespace std;
const int N = 1010;

struct node {
    int id;//学号
    double sc1, sc2;//学业成绩和素质拓展成绩
    int score;//学业成绩和素质拓展成绩的和
    double final_score;//综合分数
} a[N];

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i].id >> a[i].sc1 >> a[i].sc2;
        a[i].score = a[i].sc1 + a[i].sc2;
        a[i].final_score = a[i].sc1 * 0.7 + a[i].sc2 * 0.3;//计算综合分数
    }
    for (int i = 0; i < n; i++)
        if (a[i].score > 140 && a[i].final_score >= 80) //一定看清题
            cout << "Excellent" << endl;
        else cout << "Not excellent" << endl;

    return 0;
}

标签:11,P5742,int,深基,id,score,sc1,final,sc2
来源: https://www.cnblogs.com/littlehb/p/15575663.html