9、10两个测试点WA
#include<iostream>
#include<string.h>
#include<cmath>
using namespace std;
char c;
int win = 0, lose = 0, i, imax;
int mem[68000];
void score(int n)
{
if (mem[i]==1)
win++;
else if (mem[i]==-1)
lose++;
if (((win >= n || lose >= n) && abs(win - lose) >= 2)|| (mem[i+1] == 0 && win < n && lose < n))
{
printf("%d:%d\n", win, lose);
win = 0;
lose = 0;
}
}
int main()
{
memset(mem, 0, sizeof(mem));
i = 1;
//memory the result (with order)
while (cin >> c && c != 'E')
{
if (c == 'W')
mem[i] = 1;
else if (c == 'L')
mem[i] = -1;
i++;
}
if (mem[1] == 0)
{
cout << "0:0"<<endl<<endl<< "0:0";
return 0;
}
imax = i - 1;
for (i = 1; i <= imax; i++)
score(11);
if (imax % 11 == 0)
cout << "0:0";
cout << endl;
for (i = 1; i <= imax; i++)
score(21);
if (imax % 21 == 0)
cout << "0:0";
return 0;
}