View Code of Problem 63

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;


int main()
{
	int n;
	int mark;
	vector<string> name;
	int h[1000];
	int m[1000];
	int hr = 0;
	int mr = 0;
	cin >> n;
	for (int i = 0; i < n;i++) {
		string str;
		cin >> str;
		name.push_back(str);
		cin >> h[i];
		cin >> m[i];
		if (str == "Suxiao") {
			mark = i;
		}
	}
	for (int i = 0; i < n; i++) {
		if (h[i] > h[mark]) {
			hr++;
		}
		if (m[i] > m[mark]) {
			mr++;
		}
	}
	if (hr > mr) {
		cout << "MONEY";
	}
	else if (hr < mr) {
		cout << "HEIGHT";
	}
	else {
		cout << "EQ";
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 63