-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTCS_Examination.cpp
More file actions
55 lines (48 loc) · 1.25 KB
/
TCS_Examination.cpp
File metadata and controls
55 lines (48 loc) · 1.25 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t, a1, b1, c1, a2, b2, c2, t1, t2;
cin >> t;
while (t--)
{
cin >> a1 >> b1 >> c1;
cin >> a2 >> b2 >> c2;
t1 = a1 + b1 + c1;
t2 = a2 + b2 + c2;
if (t1 > t2)
{
cout << "DRAGON" << endl; /* code */
}
else if (t2 > t1)
{
/* code */ cout << "SLOTH" << endl;
}
else if (t1 == t2)
{
if (a1 > a2)
cout << "DRAGON" << endl;
else if (a2 > a1)
cout << "SLOTH" << endl; /* code */
else if (a1 == a2)
{
if (b1 > b2)
cout << "DRAGON" << endl;
else if (b2 > b1)
cout << "SLOTH" << endl;
else if (b1 == b2)
{
if (c1 > c2)
cout << "DRAGON" << endl;
else if (c2 > c1)
cout << "SLOTH" << endl;
else if (t1 == t2 && a1 == a2 && b1 == b2 && c1 == c2)
{
cout << "TIE\n";
}
}
}
}
}
return 0;
}