CODE:
#include<bits/stdc++.h>
using namespace std;
char temp[100001];
void pingpong(int point){
int t=1;
int h=0,d=0;
while(temp[t]!='E'){
if(h>=point||d>=point&&abs(h-d)>=2){
cout<<h<<':'<<d<<endl;
h=0,d=0;
if(temp[t]=='W')h++;
else d++;
}else{
if(temp[t]=='W')h++;
else d++;
}
t++;
}
cout<<h<<':'<<d<<endl;
}
int main(){
int i=0;
temp[i]=' ';
while(temp[i]!='E'){
i++;
cin>>temp[i];
}
pingpong(11);
cout<<endl;
pingpong(21);
return 0;
}
貌似需要输出一个“0:0”,但不懂为什么要输出也不知道要在哪里输出