Tiancheng123 @ 2024-08-05 14:55:57
#include <bits/stdc++.h>
using namespace std;
char s[62535];
int c1,c2;
int main()
{
char x;
scanf("%c",&x);
int cnt = 0;
while(x == 'W' || x == 'L' || x == '\n')
{
if(x != '\n') s[cnt++] = x;
scanf("%c",&x);
}
int n = strlen(s);
for(int t = 0;t < n;t++)
{
if(s[t] == 'W') c1++;
else c2++;
if((c1 >= 11 || c2 >= 11) && (abs(c1 - c2) >= 2))
{
printf("%d:%d\n",c1,c2);
c1 = 0;
c2 = 0;
}
}
printf("%d:%d\n\n",c1,c2);
c1 = 0;
c2 = 0;
for(int t = 0;t < n;t++)
{
if(s[t] == 'W') c1++;
else c2++;
if((c1 >= 21 || c2 >= 21) && (abs(c1 - c2) >= 2))
{
printf("%d:%d\n",c1,c2);
c1 = 0;
c2 = 0;
}
}
printf("%d:%d",c1,c2);
return 0;
}
by Kristeen @ 2024-08-05 15:06:12
879999寄
(880000被删了)
by Tiancheng123 @ 2024-08-05 15:16:16
@Kristeen ?