alphacademy-cpp/quito/10.1.cpp
2023-01-18 22:26:31 +01:00

27 lines
394 B
C++

#include <bits/stdc++.h>
using namespace std;
struct dolgozo {
int age, salary;
};
int main() {
int n;
int max = 0;
int index;
cin >>n;
vector<dolgozo> v(n);
for (int i =0; i<n; i++) {
cin >> v[i].age >> v[i].salary;
if (v[i].age > max) {
max = v[i].age;
index = i;
}
}
cout<<v[index].salary;
}