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

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

bool compare(const Student& a, const Student& b) {
    return a.score > b.score;
}

int main() {
    Student s[5];

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

    sort(s, s + 5, compare);

    for (int i = 0; i < 5; i++) {
        cout << i + 1 << ". "<< s[i].score << "점" << 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: