View Code of Problem 63

#include <stdio.h>
#include <string.h>
typedef struct{
	char name[40];
	int high;
	int money;
}student;
int main(){
	int N,hl=1,ml=1,i,k;
	scanf("%d",&N);
	student a[N];
	for(i=0;i<N;i++){
		scanf("%s %d %d",a[i].name,&a[i].high,&a[i].money);
		if(strcmp(a[i].name,"Suxiao")==0) k=i;
	}
	for(i=0;i<N;i++){
		if(strcmp(a[i].name,"Suxiao")==0) continue;
		else{
			if(a[i].high>a[k].high) hl++;
			if(a[i].money>a[k].money) ml++;
		}
	}
	if(hl>ml) printf("MONEY");
	else if(hl<ml) printf("HEIGHT");
	else printf("EQ");
}

Double click to view unformatted code.


Back to problem 63