#include <iostream>

using namespace std;

struct Student {
    char name[10];
    int score;
};

int main() {
    Student s[3] = {
        {"철수", 85},
        {"영희", 92},
        {"민수", 78}
    };

    int a = 0;
    for (int i = 1; i < 3; i++) {
        if (s[i].score > s[a ].score) {
            a  = i;
        }
    }

    cout << "최고 점수를 받은 학생은 " << s[a].name << "입니다.\n";

    return 0;
}

Embed on website

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