题解
2023-06-27 19:22:51
发布于:上海
38阅读
0回复
0点赞
#include<iostream>
#include<cstring>
using namespace std;
int main(){
string s1[101],s2[101];
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>s1[i]>>s2[i];
}
int sum = 0;
for(int i=0;i<n;i++){
if((s1[i]=="Rock" and s2[i]=="Scissors") || (s1[i]=="Paper" and s2[i]=="Rock") ||(s1[i]=="Scissors" and s2[i]=="Paper") ){
cout<<"Player1"<<endl;
}else if((s2[i]=="Rock" and s1[i]=="Scissors") || (s2[i]=="Paper" and s1[i]=="Rock") ||(s2[i]=="Scissors" and s1[i]=="Paper")){
cout<<"Player2"<<endl;
}else if(s1[i]==s2[i]){
cout<<"Tie"<<endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个