View Code of Problem 63

#include<stdio.h>
#include<string.h>
struct student
{
    char name[20];
	int height;
	int  money;	
};
int main()
{
	struct student stu[100];
	int n,h,rh=1,rm=1,i,k;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s %d %d",&stu[i].name,&stu[i].height,&stu[i].money);
		if(strcmp(stu[i].name,"Suxiao")==0)
			k=i;
    }
    	for(i=0;i<n;i++)
		{
			if(i!=k)
			{
			if(stu[i].height>stu[k].height)
			rh++;
			if(stu[i].money>stu[k].money)
			rm++;  
		    }
		}
    if(rh<rm)
    printf("HEIGHT\n");
    if(rh>rm)
    printf("MONEY\n");
    if(rh==rm)
    printf("EQ\n");
	return 0;
}

Double click to view unformatted code.


Back to problem 63