为什么编译失败?
查看原帖
为什么编译失败?
396428
南宫铱星楼主2024/5/15 20:32
#include <iostream>
using namespace std;
struct stuInfo{
    int id, scoreA, scoreB, totalScore;
    void getStuInfo(){
        cin >> id >> scoreA >> scoreB;
    }
    void getTotalScore(){
        totalScore = scoreA * 7 + scoreB * 3;
    }
    void isExcellent(){
        if(140 < (scoreA + scoreB) && 800 <= totalScore)
            cout << "Excellent" << endl;
        else
            cout << "Not excellent" << endl;
    }
}student[1000];


int main(){
    int n; cin >> n;
    for(int i = 0; i < n; i++){
        student[i].getStuInfo();
        student[i].getTotalScore();
    }
    for(int i = 0; i < n; i++)student[i].isExcellent();
    return 0;
}
2024/5/15 20:32
加载中...