2 solutions

  • 1
    @ 2025-7-22 15:58:11

    #include<bits/stdc++.h> using namespace std;

    int main(){ int n; cin>>n;

    for(int i=0;i<n;i++){ string s1,s2; cin>>s1>>s2; if(s1s2){ cout<<"Tie"; }else if(s1[0]'R'&&s2[0]'S'||s1[0]'S'&&s2[0]'P'||s1[0]'P'&&s2[0]=='R'){ cout<<"Player1"; }else{ cout<<"Player2"; } cout<<endl; } return 0; }

    • 0
      @ 2025-7-27 11:13:38

      #include<bits/stdc++.h> using namespace std; string t[150];string t2[150]; int n; int main(){ string s1; string s2; cin>>n; for(int i=1;i<=n;i++){ cin>>s1; cin>>s2; if(s1s2){ cout<<"Tie"<<endl; }else if(s1"Rock"&&s2=="Scissors"||s1=="Scissors"&&s2=="Paper"||s1=="Paper"&&s2=="Rock"){ cout<<"Player1"<<endl; }else { cout<<"Player2"<<endl; } //"Rock", "Scissors", "Paper" }

      return 0;
      

      }

      • 1

      Information

      ID
      189
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      5
      Tags
      (None)
      # Submissions
      37
      Accepted
      16
      Uploaded By