蒟蒻0分求助!为什么dev通过,洛谷却全WA!
查看原帖
蒟蒻0分求助!为什么dev通过,洛谷却全WA!
756608
andy605楼主2023/9/25 20:09
#include <bits/stdc++.h>
using namespace std;
string str[4][4]={
    {"","","",""},
    {"","Tie","Player 2","Player 1"},
    {"","Player 1","Tie","Player 2"},
    {"","Player 2","Player 1","Tie"}
}; 
int main(){
    int n;
    string str1,str2;
    int s1,s2;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>str1>>str2;
        if(!strcmp(str1.c_str(),"Rock")) s1=1;
        else if(!strcmp(str1.c_str(),"Scissors")) s1=2;
        else s1=3;
        if(!strcmp(str2.c_str(),"Rock")) s2=1;
        else if(!strcmp(str2.c_str(),"Scissors")) s2=2;
        else s2=3;
        cout<<str[s1][s2]<<endl;
    }
    return 0;
}

dev过了,洛谷却没过!望大佬帮忙!!!感谢!

2023/9/25 20:09
加载中...