View Code of Problem 63

#include<stdio.h>
#include<string.h>
typedef struct advantage{
	char a[100];
	int height;
	int money;
}str1;
int main()
{
	int i,j,n;
	int index;
	scanf("%d", &n);
	str1 s[1000];
	int height=0,money=0;
	for(i=0;i<n;i++)
	{
		scanf("%s %d %d", s[i].a, &s[i].height, &s[i].money);
		if(strcmp(s[i].a,"Suxiao")==0)
		{
			index=i;
		} 
	}
	for(j=0;j<n;j++)
	{
		if(index!=j)
		{
			if(s[j].height<s[index].height)
				height++;
			if(s[j].money<s[index].money)
				money++;
		}
	}
	if(money==height)
	{
		printf("EQ\n");
	}
	if(money>height)
	{
		printf("MONEY\n");
	}
	if(height>money)
	{
		printf("HEIGHT\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 63