90pts,求调
查看原帖
90pts,求调
1331246
Guanguplussss楼主2024/10/13 11:12

#1WA

#include<bits/stdc++.h>
using namespace std;
string s,t;
int hh,ds;
int main(){
	while(cin>>t){
		s+=t;
	}
	if(s[0]=='E'){
		return 0;
	}
	for(int i=0;i<s.length()-1;i++){
		if(s[i]=='W'){
			hh++;
		}
		if(s[i]=='L'){
			ds++;
		}
		if(hh>=11&&hh-ds>=2||ds>=11&&ds-hh>=2){
			cout<<hh<<':'<<ds<<endl;
			hh=0;
			ds=0;
		}
	}
	cout<<hh<<':'<<ds<<endl;
	hh=0;
	ds=0;
	cout<<endl;
	for(int i=0;i<s.length()-1;i++){
		if(s[i]=='W'){
			hh++;
		}
		if(s[i]=='L'){
			ds++;
		}
		if(hh>=21&&hh-ds>=2||ds>=21&&ds-hh>=2){
			cout<<hh<<':'<<ds<<endl;
			hh=0;
			ds=0;
		}
	}
	cout<<hh<<':'<<ds<<endl;
	hh=0;
	ds=0;
	return 0;
}
2024/10/13 11:12
加载中...