解题思路:
注意事项:
参考代码:
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[10000];
for(int i = 0; i < n; i++){
string s1,s2;
cin >> s1 >> s2;
if(s1 == "Rock" && s2 == "Scissors"||s1 == "Scissors" && s2 == "Paper"||s1 == "Paper" && s2 == "Rock")
a[i] = 1;
else if(s2 == "Rock" && s1 == "Scissors"||s2 == "Scissors" && s1 == "Paper"||s2 == "Paper" && s1 == "Rock")
a[i] = 2;
else
a[i] = 3;
}
for(int i = 0; i < n; i++){
if(a[i] == 1)
cout << "Player1" << endl;
if(a[i] == 2)
cout << "Player2" << endl;
if(a[i] == 3)
cout << "Tie" << endl;
}
return 0;
}
0.0分
2 人评分