uva 1636 概率

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	string str;
	while (cin >> str)
	{
		int a = 0, b = 0, len = str.size();
		for (int i = 0; i < len; i++)
			if (str[i] == '0')
			{
				b++;
				if (str[(i + 1) % len] == '0')
					a++;
			}
		cout << (a * len == b * b ? "EQUAL" : (a * len > b * b ? "SHOOT" : "ROTATE")) << endl;
	}
	return 0;
}


照书上做就好

你可能感兴趣的:(uva 1636 概率)