1 solutions

  • 0
    @ 2025-11-5 18:35:39

    C++ :

    #include<iostream>
    using namespace std;
    
    const string S = "Scissors";
    const string P = "Paper";
    const string R = "Rock";
    
    int main()
    {
    	int turn;
    	string p1, p2;
    	cin >> turn;
    	while(turn--)
    	{
    		cin >> p1 >> p2;
    		if((p1==S && p2==P) || (p1==P && p2==R) || (p1==R && p2==S)){
    			puts("Player1");
    		}
    		else if(p1==p2){
    			puts("Tie");
    		}
    		else{
    			puts("Player2");
    		} 
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    18945
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By