提交时间:2024-02-06 19:24:36
运行 ID: 39981
#include<iostream> #include<string> using namespace std; int main(){ int n=0; cin>>n; string s1[n]; string s2[n]; string game[3]={"Rock", "Scissors", "Paper"}; for(int i=0;i<n;i++){ cin>>s1[i]>>s2[i];//输入 } //判断 for(int i=0;i<n;i++){ //平局 if(s1[i]==s2[i]){ cout<<"tie"<<endl; } //1 if((s1[i]==game[0]&&s2[i]==game[1]) || (s1[i]==game[1]&&s2[i]==game[2]) || (s1[i]==game[2]&&s2[i]==game[0])){ cout<<"Player1"<<endl; } //2 if((s1[i]==game[0]&&s2[i]==game[2]) || (s1[i]==game[1]&&s2[i]==game[0]) || (s1[i]==game[2]&&s2[i]==game[1])){ cout<<"Player2"<<endl; } } return 0; }