题解
2023-07-02 14:33:16
发布于:广东
5阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
string p1[1001],p2[1001];
cin>>n;
for(int i=1;i<=n;i++) cin>>p1[i]>>p2[i];
for(int i=1;i<=n;i++){
if(p1[i]=="Rock"&&p2[i]=="Scissors") cout<<"Player1"<<endl;
else if(p1[i]=="Paper"&&p2[i]=="Rock") cout<<"Player1"<<endl;
else if(p1[i]=="Scissors"&&p2[i]=="Paper") cout<<"Player1"<<endl;
else if(p1[i]=="Scissors"&&p2[i]=="Rock") cout<<"Player2"<<endl;
else if(p1[i]=="Rock"&&p2[i]=="Paper") cout<<"Player2"<<endl;
else if(p1[i]=="Paper"&&p2[i]=="Scissors") cout<<"Player2"<<endl;
else cout<<"Tie"<<endl;
}
return 0;
}
这里空空如也
有帮助,赞一个