View Code of Problem 63

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
	int n,i,x,y,k;
	scanf("%d",&n);
	char na[10000];
	int h[1000];
	int m[1000];
	for(i=0;i<n;i++){
		scanf("%s %d %d",&na[i],&h[i],&m[i]);
	}
	
	for(i=0;i<n;i++){
		if(na[i]=='Suxiao'){
			k=i;
		}
	}
	x=0;
	y=0;
	for(i=0;i<n;i++){
		if(h[i]<h[k]){
			x++;
		}
		if(m[i]<m[k]){
			y++;
		}
	}
	if(x>y){
		printf("HEIGHT\n");
	}
	else if(x<y){
		printf("MONEY\n");
	}
	else
		printf("EQ\n");
}

Double click to view unformatted code.


Back to problem 63