Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include <iostream>
- #include <string>
- using namespace std;
- struct SInfo
- {
- string name;
- int sum;
- };
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- int i, k, N, mark, max;
- string fio, name;
- SInfo Info[250];
- cin >> N;
- for (int i = 0; i<N; i++)
- Info[i].sum = 0;
- for (int i = 0; i<N; i++)
- {
- cin >> fio >> name;
- Info[i].name = fio + " " + name;
- for (int j = 0; j<3; j++)
- {
- cin >> mark;
- Info[i].sum += mark;
- }
- }
- max = Info[0].sum;
- for (int i = 0; i<N; i++)
- {
- if (Info[i].sum > max)
- max = Info[i].sum;
- }
- for (int i = 0; i<N; i++)
- {
- if (Info[i].sum == max)
- cout << Info[i].name<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement