#include <iostream>
#include <climits>

using namespace std;

struct fruit {
    string name;
    int price;
};

int main() {
    int N;
    cin >> N;

    fruit maxFruit;
    maxFruit.price = -1;

    for (int i = 0; i < N; i++) {
        fruit f;
        cin >> f.name >> f.price;

        if (f.price > maxFruit.price) {
            maxFruit = f;
        }
    }

    cout << "가장 비싼 제품: " << maxFruit.name << "(" << maxFruit.price << "원)" << 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: