View Code of Problem 63

#include <stdio.h>
#include <string.h>
struct student{
	char name[20];
	int h;
	int m;
}stu[1000];
int main(){
	int n,i,j,w,a=0,b=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s %d %d",&stu[i].name,&stu[i].h,&stu[i].m);
	} 
	for(i=0;i<n;i++)
	{
		if(strcmp(stu[i].name,"Suxiao")==0)
		w=i;
	}
	for(i=0;i<n;i++)
	{
	    if(stu[i].h<stu[w].h) 
		a++;
	} 
	for(i=0;i<n;i++)
	{
		if(stu[i].m<stu[w].m) b++;
	}
	if(a>b) 
	{
		printf("HEIGHT\n");
	}
	else if(a<b)
	{
		printf("MONEY\n");
	} 
	
	else 
	{
		printf("EQ\n");	
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 63