50分求条
查看原帖
50分求条
1627385
loatic楼主2024/12/28 13:42
#include<bits/stdc++.h>
using namespace std;
char a[62505];
int main()
{
	char c;
	int n=0;
	while(cin>>c){
		a[++n]=c;
		if(c=='E') break;
	}
	int wc=0,lc=0,com=0;
	for(int i=1;i<=n;i++){
		if(a[i]=='W') wc++;
		else if(a[i]=='L') lc++;
		else{
			cout<<wc<<":"<<lc<<endl;
		}
		com++;
		if(com==11&&abs(lc-wc)>=2){
			cout<<wc<<":"<<lc<<endl;
			wc=lc=com=0;
		}
	}
	puts("");
	wc=lc=com=0;
	for(int i=1;i<=n;i++){
		if(a[i]=='W') wc++;
		else if(a[i]=='L') lc++;
		else{
			cout<<wc<<":"<<lc<<endl;
		}
		com++;
		if(com==21&&abs(lc-wc)>=2){
			cout<<wc<<":"<<lc<<endl;
			wc=lc=com=0;
		}
	}
	return 0;
}
2024/12/28 13:42
加载中...