50分,求带
查看原帖
50分,求带
1441391
Xu0120楼主2025/1/16 16:10
#include<bits/stdc++.h>
using namespace std;
int main(){
	char a[62530];
	int i=0,u=0,b=0;
	while(a[i-1]!='E'){
		cin>>a[i];
		i++;
		if(a[i-1]=='W')
		u++;
		if(a[i-1]=='L')
		b++;
		if((u==11 or b==11) and ((b-u)*(b-u)>=4)){
			cout<<u<<":"<<b<<endl;
			u=0;
			b=0;
		}
	}
	if(u!=0 or b!=0){
		cout<<u<<":"<<b<<endl;
			u=0;
			b=0;
	}
	if(i==1){
		cout<<"0:0"<<endl<<endl<<"0:0";
		return 0;
	}
	i=0;
	cout<<endl;
	while(a[i-1]!='E'){
		i++;
		if(a[i-1]=='W')
		u++;
		if(a[i-1]=='L')
		b++;
		if((u==21 or b==21) and ((b-u)*(b-u)>=4)){
			cout<<u<<":"<<b<<endl;
			u=0;
			b=0;
		}
	}
	if(u!=0 or b!=0){
		cout<<u<<":"<<b<<endl;
	}
	
	
}
2025/1/16 16:10
加载中...