求助!!!!就一个点过不了!!!
查看原帖
求助!!!!就一个点过不了!!!
1358546
Richard2024楼主2024/10/27 17:27
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//man what can i say?
//manba out!
char c;
string s;
int main(){
	cin.tie(0);
	cout.tie(0);
	while (cin >> c){
		if (c == 'E') break;
		s += c;
	}
	if (s.size() == 0){
		cout << "0:0\n\n0:0";
		return 0;
	}
	int me = 0, other = 0;
	for (int i=0;i<s.size();i++){
		if ((me - other >= 2 || other - me >= 2) && (me >= 11 || other >= 11)){
			cout << me << ":" << other << endl;
			me = 0, other = 0;
		}
		if (s[i] == 'W') me++;
		else if (s[i] == 'L') other ++;
	}
	if (me !=0 || other != 0) cout << me << ":" << other << endl;
	me = 0, other = 0;
	cout << endl;
	for (int i=0;i<s.size();i++){
		if ((me - other >= 2 || other - me >= 2) &&(me >= 21 || other >= 21)){
			cout << me << ":" << other << endl;
			me = 0, other = 0;
		}
		if (s[i] == 'W') me++;
		else if (s[i] == 'L') other ++;
	}
	if (me !=0 || other != 0) cout << me << ":" << other << endl;
	me = 0, other = 0;
	return 0;
}

2024/10/27 17:27
加载中...