捞
查看原帖
捞
1147447
_None楼主2023/11/25 21:15
#include<bits/stdc++.h>
using namespace std;

int main(){
	char c[1000000],temp;
	int w=0,n=0,s,l=0,js=0;
	while(temp!='E'){
		cin>>temp;
		c[n]=temp;
		n++;
	}
	n=0;
	s=strlen(c)-1;
	while(true){
		int i=n;
		while(true){
			if(i==s)break;
			if(c[i]=='W'){
				w++;
			}
			else if(c[i]=='L'){
				l++;
			}
			if(max(w,l)-min(w,l)>=2&&max(w,l)>=11){
				break;
			}
			else{
				js++;
			}
			i++;
			
		}
		cout<<w<<":"<<l<<endl;
		n+=w+l;
		if(l+w<11)break;
		w=0;
		l=0;
		
	}
	w=0;
	l=0;
	n=0;
	js=0;
	cout<<endl;
	while(true){
		int i=n;
		while(true){
			if(i==s)break;
			if(c[i]=='W'){
				w++;
			}
			else if(c[i]=='L'){
				l++;
			}
			if(max(w,l)-min(w,l)>=2&&max(w,l)>=21){
				break;
			}
			else{
				js++;
			}
			i++;
		}
		cout<<w<<":"<<l<<endl;
		n+=w+l;
		if(l+w<21)break;
		w=0;
		l=0;
		
	}
}

80分

2023/11/25 21:15
加载中...