#include <bits/stdc++.h>
#define ll long long
using namespace std;
void game(string &s, int score) {
if (s.empty()) {
printf("0:0\n");
return;
}
int w=0, l=0;
for(char ch : s) {
if(ch == 'W') w++;
else if (ch== 'L')l++;
if((w>=score || l>=score) && abs(w-l)>=2) {
printf("%d:%d\n", w, l);
w=l=0;
}
}
if(w!=0 || l!=0) printf("%d:%d\n",w,l);
}
int main() {
string s;
char ch;
while((ch=getchar())!='E') if(ch!='\n') s.push_back(ch);
game(s, 11);
printf("\n");
game(s, 21);
return 0;
}
刚从 c 换到 c++ 还不是很适应。