球球各位大佬帮忙检查为什么无法通过
查看原帖
球球各位大佬帮忙检查为什么无法通过
460806
WYJYJYJ楼主2021/1/2 17:35

#include #include using namespace std; int main() { char a[62500] = { 0 }; cin>>a; int s1 = 0, s2 = 0, s3 = 0, s4 = 0; for (int i = 0; i < 62500; i++) { if (a[i] == 'W')s1 = s1 + 1; if (a[i] == 'L')s2 = s2 + 1; if (s1 == 11 || s2 == 11) { if (abs(s1 - s2) >= 2) { cout << s1 << ":" << s2 << endl; s1 = 0, s2 = 0; } else for (i; i < 62500; i++) { if (a[i] == 'W')s1 = s1 + 1; if (a[i] == 'L')s2 = s2 + 1; if (abs(s1 - s2) >= 2) { cout << s1 << ":" << s2 << endl; s1 = 0, s2 = 0; } }

    }
    if (a[i] == 'E')
    {
        cout << s1 << ":" << s2 << endl;
        s1 = 0, s2 = 0;
        break;
    }
}
cout << endl;
for (int i = 0; i < 62500; i++)
{
    if (a[i] == 'W')s1 = s1 + 1;
    if (a[i] == 'L')s2 = s2 + 1;
    if (s1 == 21 || s2 == 21)
    {
        if (abs(s1 - s2) >= 2)
        {
            cout << s1 << ":" << s2 << endl;
            s1 = 0, s2 = 0;
        }
        else for (i; i < 62500; i++)
        {
            if (a[i] == 'W')s1 = s1 + 1;
            if (a[i] == 'L')s2 = s2 + 1;
            if (abs(s1 - s2) >= 2)
            {
                cout << s1 << ":" << s2 << endl;
                s1 = 0, s2 = 0;
            }
        }
    }
    if (a[i] == 'E')
    {
        cout << s1 << ":" << s2;
        break;
    }
}
return 0;
}
2021/1/2 17:35
加载中...