View Code of Problem 63

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

void main(){
	int n,i,t,g1=1,g2=1;//g1是身高,g2是money
	struct person per[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%s %d %d",&per[i].name,&per[i].height,&per[i].money);
	for(i=0;i<n;i++){
		if(strcmp(per[i].name,"Suxiao")==0)
			t=i;
	}
	for(i=0;i<n;i++){
		if(per[t].height<per[i].height)
			g1++;
		if(per[t].money<per[i].money)
			g2++;
	}
	if(g1==g2)
		printf("EQ\n");
	else if(g1<g2)
		printf("HEIGHT\n");
	else
		printf("MONEY\n");
}

Double click to view unformatted code.


Back to problem 63