题解
2024-09-04 21:19:22
发布于:江苏
0阅读
0回复
0点赞
#include<bits/stdc++.h>
#define ll long long //防伪标识
#define MAXN 1005
#define maxn 10005
#define MAXM 10000
#define maxm 1000005
#define r "Rock"
#define s "Scissors"
#define p "Paper"
#define o "Player1"<<endl
#define w "Player2"<<endl
#define t "Tie"<<endl
using namespace std;
string a,b;
int n;
int main(){
cin>>n;
for(int i = 1;i<=n;i++){
cin>>a>>b;
if(a == r&&b == s) cout<<o;
if(a == r&&b == p) cout<<w;
if(a == r&&b == r) cout<<t;
if(a == s&&b == s) cout<<t;
if(a == s&&b == p) cout<<o;
if(a == s&&b == r) cout<<w;
if(a == p&&b == s) cout<<w;
if(a == p&&b == p) cout<<t;
if(a == p&&b == r) cout<<o;
}
return 0;
}
这里空空如也
有帮助,赞一个