求调!回者必关
查看原帖
求调!回者必关
1283023
liumoumou_haha楼主2024/8/23 11:28
#include<bits/stdc++.h>
using namespace std;
int f[2]={11,21};
int a[25*2500+10],n=0;//两种赛制的获胜得分 
int main()
{
	char tmp;
	while(1)
	{
		cin>>tmp;//不断读入结果 
	    if(tmp=='E') break;
		else if(tmp=='W') a[n++]=1;//华华赢
		else if(tmp=='L') a[n++]=0 ;//华华输 
	}
	for(int k=0;k<2;k++)//两种赛制循环 
	{
		int w=0,l=0;
		for(int i=0;i<n;i++)
		{
			w+=a[i];
			l+=1-a[i];
			if(max(w,l)>=f[k]&&abs(w-l)>=2)
			{
				cout<<w<<": "<<l<<endl;
				w=l=0;
			} 
			 cout<<w<<": "<<l<<endl;
			 cout<<endl;
		}
	}
	return 0;
}
2024/8/23 11:28
加载中...