漂流瓶50pts
查看原帖
漂流瓶50pts
947200
AIregister楼主2024/10/12 15:17
#include <bits/stdc++.h>
using namespace std;
struct k {
	long long w, l;
};
k a[10000001];
k b[10000001];
long long cnt1 = 1;
long long cnt2 = 1;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	char c;
	while (1) {
		cin >> c;
		if (c == 'E') {
			break;
		}
		if (c == 'W') {
			a[cnt1].w++;
			b[cnt2].w++;
		}
		if (c == 'L') {
			a[cnt1].l++;
			b[cnt2].l++;
		}
		if (a[cnt1].w + a[cnt1].l == 11) {
			cnt1++;
		}
		if (b[cnt2].w + b[cnt2].l == 21) {
			cnt2++;
		}
	}
	for (int i = 1; i <= cnt1; i++) {
		cout << a[i].w << ":" << a[i].l;
		cout << endl;
	}
	cout << endl;
	for (int i = 1; i <= cnt2; i++) {
		cout << b[i].w << ":" << b[i].l;
		cout << endl;
	}
	return 0;
}

求条,玄三关

2024/10/12 15:17
加载中...