20分求助
查看原帖
20分求助
959788
__kunkun__楼主2023/7/17 15:11

C++语言,样例过了,但只有20分,求大佬帮助。

#include<bits/stdc++.h>
using namespace std;
int main(){
    string p1,p2;
    int T;
    cin>>T;
    while(T--){
        cin>>p1>>p2;
        if(p1==p2)cout<<"Tie"<<endl;
        else if(p1=="Rock"){
            if(p2=="Scissors")cout<<"Player1"<<endl;
            else cout<<"Player2"<<endl;
        }
        else if(p1=="Scissors"){
            if(p2=="PaPer")cout<<"Player1"<<endl;
            else cout<<"Player2"<<endl;
        }
        else{
            if(p2=="Rock")cout<<"Player1"<<endl;
            else cout<<"Player2"<<endl;
        }
    }
    return 0;
}
2023/7/17 15:11
加载中...