-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4493.cpp
85 lines (81 loc) · 910 Bytes
/
4493.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// 4493. 가위 바위 보?
// 2019.09.04
// 입문용
#include<iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t-- > 0)
{
int p1 = 0;
int p2 = 0;
int draw = 0;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
char x, y;
cin >> x >> y;
if (x == 'R')
{
if (y == 'R')
{
draw++;
}
else if (y == 'S')
{
p1++;
}
else
{
p2++;
}
}
else if (x == 'S')
{
if (y == 'R')
{
p2++;
}
else if (y == 'S')
{
draw++;
}
else
{
p1++;
}
}
else if (x == 'P')
{
if (y == 'R')
{
p1++;
}
else if (y == 'S')
{
p2++;
}
else
{
draw++;
}
}
}
if (p1 > p2)
{
cout << "Player 1" << endl;
}
else if (p2 > p1)
{
cout << "Player 2" << endl;
}
else
{
cout << "TIE" << endl;
}
}
return 0;
}