1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#include<iostream> using namespace std; int main(){ char word[62500]; int awin=0,bwin=0,i; for(i=1;;i++){ cin>>word[i]; if(word[i]=='W'){ word[i]=1; }else if(word[i]=='L'){ word[i]=2; }else if(word[i]=='E'){ word[i]=0; break; } } for(int o=1;o<=i;o++){ if(word[o]==1){ awin++; }else if(word[o]==2){ bwin++; }if(word[o]==0){ cout<<awin<<":"<<bwin<<endl<<endl; } if(awin-bwin>=2||bwin-awin>=2){ if(awin>=11||bwin>=11){ cout<<awin<<":"<<bwin<<endl; awin=0; bwin=0; } } } awin=0; bwin=0; for(int o=1;o<=i;o++){ if(word[o]==1){ awin++; }else if(word[o]==2){ bwin++; }if(word[o]==0){ cout<<awin<<":"<<bwin<<endl<<endl; } if(awin-bwin>=2||bwin-awin>=2){ if(awin>=21||bwin>=21){ cout<<awin<<":"<<bwin<<endl; awin=0; bwin=0; } } } return 0; }
|