View Code of Problem 63

#include <iostream>
using namespace std;
string s[1010];
int h[1010];
int m[1010];
int main(){
	int n;
	cin>>n;
	int cn1=0,cn2=0;
	int a,b;
	for(int i=0;i<n;i++){
		cin>>s[i]>>h[i]>>m[i];
		if(s[i]=="Suxiao"){
			a=h[i];
			b=m[i];
		}
	}
	for(int i=0;i<n;i++){
		if(h[i]>a)
			cn1++;
		if(m[i]>b)
			cn2++;
	}
	if(cn1<cn2)
		cout<<"HEIGHT";
	else if(cn2<cn1)
		cout<<"MONEY";
	else
		cout<<"EQ";
	return 0;
}

Double click to view unformatted code.


Back to problem 63