#include <iostream>
#include <string>
using namespace std;

class Student {
public:
    string name;
    int score;
};

int main() {
    Student students[5];
    int sum = 0;

    for (int i = 0; i < 5; i++) {
        cin >> students[i].name;
        cin >> students[i].score;
        sum += students[i].score;
    }

    double average = sum / 5.0;
    cout << "\n평균 점수: " << average << endl;
    cout << "평균 이상 학생 이름:\n";

    for (int i = 0; i < 5; i++) {
        if (students[i].score >= average) {
            cout << students[i].name << endl;
        }
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: