50分
查看原帖
50分
261871
SZ2528楼主2020/8/10 16:19

RT

#include<bits/stdc++.h>
using namespace std;
void tj(string s,int n){
	int w=0,l=w;
	for(int i=0;i<s.length();i++){
		if(max(w,l)==n && abs(w-l)>=2){
			cout<<w<<":"<<l<<endl;
			w=0,l=w;
		}
		if(s[i]=='W') w++;
		else l++;
	}
	cout<<w<<":"<<l<<endl;
}
int main(){
	string s;
	while(true){
		char c=getchar();
		if(c=='E') break;
		if(c=='W' || c=='L') s+=c;
	}
	tj(s,11);
	cout<<endl;
	tj(s,21);
	return 0;
}
2020/8/10 16:19
加载中...