60分求助
查看原帖
60分求助
217577
kemkra楼主2020/6/30 16:23
#include <iostream>
#include <cmath>
#include <string>

using namespace std;

int main()
{
	string info[2500];
	int w_11[5682], l_11[5682];
	int w_21[2977], l_21[2977];
	int count[2] = {0, 0};
	bool e = 0;
	for (int i = 0; i < 2500; i++)
	{
		cin >> info[i];
		for (int j = 0; j < info[i].length(); j++)
		{
			switch(info[i][j])
			{
			case 'W':
				w_11[count[0]]++;
				w_21[count[1]]++;
				break;
			case 'L':
				l_11[count[0]]++;
				l_21[count[1]]++;
				break;
			case 'E':
				e = 1;
				break;
			}
			if (e == 1)
			{
				break;
			}
			if ((w_11[count[0]] + l_11[count[0]]) >= 11 && abs(w_11[count[0]] - l_11[count[0]]) >= 2)
			{
				count[0]++;
			}
			if ((w_21[count[1]] + l_21[count[1]]) >= 21 && abs(w_21[count[1]] - l_21[count[1]]) >= 2)
			{
				count[1]++;
			}
		}
		if (e == 1)
		{
			break;
		}
	}
	for (int i = 0; i <= count[0]; i++)
	{
		cout << w_11[i] << ":" << l_11[i] << endl;
	}
	for (int i = 0; i <= count[1]; i++)
	{
		cout << endl << w_21[i] << ":" << l_21[i];
	}
	return 0;
}
2020/6/30 16:23
加载中...