#include <bits/stdc++.h>
using namespace std;
string s;
int main(){
char t;
int x=0,y=0,a=1;
cin>>t;
while(t!='E'){
s[a++] = t;
if(t=='W') x++;
if(t=='L') y++;
if((x>=11 || y>=11) && abs(x-y)>=2){
printf("%d:%d\n",x,y);
x=0;
y=0;
}
cin>>t;
}
printf("%d:%d\n\n",x,y);
x = 0;
y = 0;
for(int i = 1;i<a;i++){
if(s[i]=='W') x++;
if(s[i]=='L') y++;
if((x>=21 || y>=21) && abs(x-y)>=2){
printf("%d:%d\n",x,y);
x=0;
y=0;
}
}
printf("%d:%d\n",x,y);
return 0;
}
哪里错了?