View Code of Problem 63

#include <stdio.h>
#include <string.h> 
int main(int argc, char *argv[])
{
	int n;
	scanf("%d",&n);
	int m[n],h[n];
	int hight,money;
	int hP=1,mP=1;
	for(int i=0;i<n;i++){
		char name[22];
		scanf("%s %d %d",name,&h[i],&m[i]);
		if(strcmp(name,"Suxiao")==0){
			hight = h[i];
			money = m[i];
		}	
	}
	for(int i=0;i<n;i++){
		if(h[i]>hight)hP++;
		if(m[i]>money)mP++;
	}
	if(hP==mP)printf("EQ");
	else if(hP<mP){
		printf("HEIGHT");
	}else{
		printf("MONEY");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 63