90pts,#9WA
查看原帖
90pts,#9WA
1320784
yinzixia楼主2024/5/30 20:03
#include<bits/stdc++.h>
using namespace std;
char score[90000000];
int slen;
void ps(int ws){
	int my=0,e=0;
	if(slen==0){
		cout<<"0:0"<<endl;
	}
	for(int i=0;i<=slen;i++){
		if(score[i]=='W')my++;
		else if(score[i]=='L')e++;
		if(my>=ws||e>=ws){
			if(my-e>=2||e-my>=2){
				printf("%d:%d\n",my,e);
				my=0;
				e=0;
			}
		}else if(i==slen){
			printf("%d:%d\n",my,e);
		}else continue;
	}

}
int main(){
	char asd;
	while(asd!='E'){
		cin>>asd;
		score[slen++]=asd;
	}
	ps(11);
	cout<<endl;
	ps(21);
	return 0;
}
2024/5/30 20:03
加载中...