~~家人们,谁懂啊。~~本蒟蒻连这个小破题都过不去(哭哭
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
char s[100005];
int main()
{
freopen("table.in","r",stdin);
freopen("table.out","w",stdout);
char x;
int H=0,D=0,j=0,len;
while(cin >> x)
{
if(x == 'E')
{
break;
}
s[j]=x;
j++;
}
len=strlen(s);
if(len == 0)
{
printf("0:0\n\n");
printf("0:0\n");
return 0;
}
for(int i=0;i<len;i++)
{
if(s[i] == 'W')
{
H++;
}
if(s[i] == 'L')
{
D++;
}
if(max(H,D) >= 11 && abs(D-H) >= 2)
{
printf("%d:%d\n",H,D);
H=0;
D=0;
}
}
if(H || D)
{
printf("%d:%d\n\n",H,D);
H=0;
D=0;
}
for(int i=0;i<len;i++)
{
if(s[i] == 'W')
{
H++;
}
else if(s[i] == 'L')
{
D++;
}
if(max(H,D) >= 21 && abs(D-H) >= 2)
{
printf("%d:%d\n",H,D);
H=0;
D=0;
}
}
if(H || D)
{
printf("%d:%d\n",H,D);
}
return 0;
}