View Code of Problem 63

#include<stdio.h>
#include<string.h>
typedef struct student{
	char name[20];
	int height;
	int money;
}Stu;
int main()
{
     int n;
     scanf("%d",&n);
	 Stu stu[n];
	 int i;
	 int h[n],m[n],k;
	 char s[20];
	 strcpy(s,"Suxiao");
	 for(i=0;i<n;i++)
	 {
	 	scanf("%s %d %d",stu[i].name,&stu[i].height,&stu[i].money);
	 	if(strcmp(stu[i].name,s)==0)
           k=i;
	 } 
	 int temp=0,flag=0;
	 for(i=0;i<n;i++)
	 {
	 	if(stu[i].height>stu[k].height)
	 	  temp++;
	 	if(stu[i].money>stu[k].money)
	 	  flag++;
	 }
	 if(temp<flag)
	   printf("HEIGHT\n");
	 else if(temp==flag)
	   printf("EQ\n");
	 else
	   printf("MONEY\n");
}

Double click to view unformatted code.


Back to problem 63