求助
查看原帖
求助
677139
Dreams_Knight楼主2022/10/10 23:55
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	string Player1 , Player2;
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> Player1 >> Player2;
		if(Player1 == "Rock" and Player2 == "Scissors"){
			cout << "Player1"<< endl;
		}
		//AB
		else if(Player1 == "Scissors" and Player2 == "Rock"){
			cout << "Player2"<< endl;
		}
		//BA
		else if(Player1 == "Rock" and Player2 == "Paper"){
			cout << "Player2"<< endl;
		}
		//AC
		else if(player1 == "Paper" and Player2 == "Rock"){
			cout << "Player1"<< endl;
		}
		//CA
		else if (Player1 == "Scissors" and Player2 == "Paper"){
			cout << "Player1"<< endl;
		}
		//BC
		else if (Pleyer1 == "Paper" and Player2 == "Scissors"){
			cout << "Player2"<< endl;
		}
		//CB
		else if(Pleyer1 == "Rock" and Player2 == "Rock"){
			cout << "Tie"<< endl;
		}
		//AA
		else if(Pleyer1 == "Scissors" and Player2 == "Scissors"){
			cout << "Tie"<< endl;
		}
		//BB
		else if(Pleyer1 == "Paper" and Player2 == "Paper"){
			cout << "Tie" << endl;
		}
		//CC
	}
	return 0;
	
}
2022/10/10 23:55
加载中...