- 乒乓球
- 2016-03-02 22:00:25 @
#include <iostream>
#include <string>
using namespace std;
int main(){
char ch;
long W11=0,L11=0,W21=0,L21=0;
string order="";
while((ch = cin.get()) != 'E'){
order+=ch;
}
for(long i=0;i<order.length();i++){
if(order[i]=='\n')continue;
if(order[i]=='W'){
W11+=1;
}
if(order[i]=='L'){
L11+=1;
}
if(W11>=11||L11>=11){
cout<<W11<<":"<<L11<<endl;
W11=0;
L11=0;
}
}
cout<<W11<<":"<<L11<<endl<<endl;
for(long i=0;i<order.length();i++){
if(order[i]=='\n')continue;
if(order[i]=='W'){
W21+=1;
}
if(order[i]=='L'){
L21+=1;
}
if(W21>=21||L21>=21){
cout<<W21<<":"<<L21<<endl;
W21=0;
L21=0;
}
}
cout<<W21<<":"<<L21;
}