'commit'
This commit is contained in:
36
TangDou/XiTi/1095.cpp
Normal file
36
TangDou/XiTi/1095.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n;
|
||||
string a[10];
|
||||
for (int i = 0; i < n; ++i) {
|
||||
string s1, s2;
|
||||
cin >> s1 >> s2;
|
||||
//Rock 石头
|
||||
//Scissors 剪刀
|
||||
//Paper 布
|
||||
if (s1 == s2) {
|
||||
a[i] = "Tie";
|
||||
} else if (s1[0] == 'R' && s2[0] == 'S') {
|
||||
a[i] = "Player1";
|
||||
} else if (s1[0] == 'R' && s2[0] == 'P') {
|
||||
a[i] = "Player2";
|
||||
} else if (s1[0] == 'S' && s2[0] == 'R') {
|
||||
a[i] = "Player2";
|
||||
} else if (s1[0] == 'S' && s2[0] == 'P') {
|
||||
a[i] = "Player1";
|
||||
} else if (s1[0] == 'P' && s2[0] == 'R') {
|
||||
a[i] = "Player1";
|
||||
} else if (s1[0] == 'P' && s2[0] == 'S') {
|
||||
a[i] = "Player2";
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
cout << a[i] << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user