-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWho_Is_It.cpp
42 lines (37 loc) · 1.06 KB
/
Who_Is_It.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
class Student
{
public:
int id;
char name[100];
char section;
int total_marks;
};
int main()
{
int t;
cin >> t;
while (t--)
{
Student One;
Student Two;
Student Three;
cin >> One.id >> One.name >> One.section >> One.total_marks;
cin >> Two.id >> Two.name >> Two.section >> Two.total_marks;
cin >> Three.id >> Three.name >> Three.section >> Three.total_marks;
if (One.total_marks >= Two.total_marks && One.total_marks >= Three.total_marks)
{
cout << One.id << " " << One.name << " " << One.section << " " << One.total_marks << endl;
}
else if (Two.total_marks >= One.total_marks && Two.total_marks >= Three.total_marks)
{
cout << Two.id << " " << Two.name << " " << Two.section << " " << Two.total_marks << endl;
}
else
{
cout << Three.id << " " << Three.name << " " << Three.section << " " << Three.total_marks << endl;
}
}
return 0;
}