View Code of Problem 63

#include<stdio.h>
#include<string.h>
typedef struct{
	char name[20];
	int height;
	int money;
}Person;

void main() {
	int n,i,k,a=0,b=0;
	scanf("%d",&n);
	Person s[n];
	for(i=0; i<n; i++) 
		scanf("%s %d %d",&s[i].name,&s[i].height,&s[i].money);
	for(i=0; i<n; i++)
		if(strcmp("Suxiao",s[i].name)==0) k=i;
	for(i=0; i<n; i++)
		if(s[k].height>s[i].height) a++;
	for(i=0; i<n; i++)
		if(s[k].money>s[i].money) b++;
	if(a>b)
		printf("HEIGHT\n");
	else if(a<b)
		printf("MONEY\n");
	else
		printf("EQ\n");
}


Double click to view unformatted code.


Back to problem 63