样例过了,结果全红,不知为何
查看原帖
样例过了,结果全红,不知为何
787888
Channel_Choo楼主2022/12/24 20:06
#include <iostream>
using namespace std;
int main()
{
    string s1, s2;
    int n;
    cin >> n;
    for (int i = 1;i <= n;i++)
    {
        cin >> s1 >> s2;
        if ((s1[0] == 'R' && s2[0] == 'S') || (s1[0] == 'S' && s2[0] == 'P') || (s1[0] == 'P' && s1[0] == 'R'))
        {
            cout << "Plsyer1";
        }
        if ((s2[0] == 'R' && s1[0] == 'S') || (s2[0] == 's' && s1[0] == 'P') || (s2[0] == 'P' && s1[0] == 'R'))
        {
            cout << "Player2";
        }
        if (s1[0] == s2[0])
        {
            cout << "Tie";
        }
        cout << endl;
    }
    return 0;
}
2022/12/24 20:06
加载中...