#include <stdio.h>
#define MAX_NUM 400000
int main(void)
{
char Score[MAX_NUM] = {0};//每一次的分数
int Count = 0;//胜负一共的数
int Win = 0;//胜次数
int Lose = 0;//输的次数
char Temp[MAX_NUM] = {0};
char ch;
int Index = 0;
//获取输入字符
while(1)
{
ch = getchar();
//
if(ch == 'E')
{
break;
}
else if(ch == 'W' || ch == 'L')
{
Score[Count++] = ch;
}
}
//11分一局 计算并输出
while( Index <= Count)
{
//计算本局比分 有一方达到11分并且分差大于2分 或者至少一方分数大于11并且分差大于两分
while( Index < Count)
{
if(Score[Index] == 'W')
{
Win++;
Index++;
}
else if(Score[Index] == 'L')
{
Lose++;
Index++;
}
//判断输赢
if(Win == 11 && Lose < 10)
{
break;
}
else if(Lose == 11 && Win < 10)
{
break;
}
else if( Win > 11 && Win - Lose > 1 )
{
break;
}
else if( Lose > 11 && Lose - Win > 1 )
{
break;
}
}
//输出本局结果
printf("%d:%d\n", Win,Lose);
if( Win == 0 && Lose == 0 || Index == Count)
{
Win = Lose = 0;
break;
}
Win = Lose = 0;
}
//
Index = 0;
printf("\n");
//21分一局 计算并输出
while( Index <= Count)
{
//计算本局比分 有一方达到21分并且分差大于2分 或者至少一方分数大于21并且分差大于两分
while( Index < Count)
{
if(Score[Index] == 'W')
{
Win++;
Index++;
}
else if(Score[Index] == 'L')
{
Lose++;
Index++;
}
//判断输赢
if(Win == 21 && Lose < 20)
{
break;
}
else if(Lose == 21 && Win < 20)
{
break;
}
else if( Win > 21 && Win - Lose > 1 )
{
break;
}
else if( Lose > 21 && Lose - Win > 1 )
{
break;
}
}
//输出本局结果
printf("%d:%d\n", Win,Lose);
if( Win == 0 && Lose == 0 || Index == Count)
{
Win = Lose = 0;
break;
}
Win = Lose = 0;
}
//while(1);
return 0;
}
#define MAX_NUM 400000
int main(void)
{
char Score[MAX_NUM] = {0};//每一次的分数
int Count = 0;//胜负一共的数
int Win = 0;//胜次数
int Lose = 0;//输的次数
char Temp[MAX_NUM] = {0};
char ch;
int Index = 0;
//获取输入字符
while(1)
{
ch = getchar();
//
if(ch == 'E')
{
break;
}
else if(ch == 'W' || ch == 'L')
{
Score[Count++] = ch;
}
}
//11分一局 计算并输出
while( Index <= Count)
{
//计算本局比分 有一方达到11分并且分差大于2分 或者至少一方分数大于11并且分差大于两分
while( Index < Count)
{
if(Score[Index] == 'W')
{
Win++;
Index++;
}
else if(Score[Index] == 'L')
{
Lose++;
Index++;
}
//判断输赢
if(Win == 11 && Lose < 10)
{
break;
}
else if(Lose == 11 && Win < 10)
{
break;
}
else if( Win > 11 && Win - Lose > 1 )
{
break;
}
else if( Lose > 11 && Lose - Win > 1 )
{
break;
}
}
//输出本局结果
printf("%d:%d\n", Win,Lose);
if( Win == 0 && Lose == 0 || Index == Count)
{
Win = Lose = 0;
break;
}
Win = Lose = 0;
}
//
Index = 0;
printf("\n");
//21分一局 计算并输出
while( Index <= Count)
{
//计算本局比分 有一方达到21分并且分差大于2分 或者至少一方分数大于21并且分差大于两分
while( Index < Count)
{
if(Score[Index] == 'W')
{
Win++;
Index++;
}
else if(Score[Index] == 'L')
{
Lose++;
Index++;
}
//判断输赢
if(Win == 21 && Lose < 20)
{
break;
}
else if(Lose == 21 && Win < 20)
{
break;
}
else if( Win > 21 && Win - Lose > 1 )
{
break;
}
else if( Lose > 21 && Lose - Win > 1 )
{
break;
}
}
//输出本局结果
printf("%d:%d\n", Win,Lose);
if( Win == 0 && Lose == 0 || Index == Count)
{
Win = Lose = 0;
break;
}
Win = Lose = 0;
}
//while(1);
return 0;
}