View Code of Problem 63

#include<stdio.h>
#include<string.h>
struct Stu{
	char name[100];
	int h;
	int m;
}s[1000];

int main(){
	int n,x=0,y=0,k;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%s %d %d",s[i].name,&s[i].h,&s[i].m);
		if(strcmp(s[i].name,"Suxiao")==0){
			k=i;
		}
	}
	for(int i=0;i<n;i++){
		if(s[i].h>s[k].h){
			x++;
		}
		if(s[i].m>s[k].m){
			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