forked from mpfeifer1/Kattis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmia.cpp
37 lines (33 loc) · 744 Bytes
/
mia.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
#include <iostream>
using namespace std;
int getScore(int hi, int lo) {
if(lo > hi) {
swap(lo, hi);
}
if(hi == 2 && lo == 1) {
return 100000;
}
if(hi == lo) {
return hi * 100;
}
return hi * 10 + lo;
}
int main() {
int a, b, c, d;
while(cin >> a >> b >> c >> d && a != 0 && b != 0) {
int score1 = getScore(a, b);
int score2 = getScore(c, d);
if(score1 == score2) {
cout << "Tie." << endl;
continue;
}
if(score1 > score2) {
cout << "Player 1 wins." << endl;
continue;
}
if(score1 < score2) {
cout << "Player 2 wins." << endl;
continue;
}
}
}