27 lines
394 B
C++
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;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|