#include <iostream>
using namespace std;

struct Person {
    char name[20];
    int age;
};

int main() {
    Person p[3];
    int maxIdx = 0;

    for (int i = 0; i < 3; i++) {
        cin >> p[i].name;
        cin >> p[i].age;
    }

    for (int i = 1; i < 3; i++) {
        if (p[i].age > p[maxIdx].age) {
            maxIdx = i;
        }
    }

    cout << p[maxIdx].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: