View Code of Problem 63

#include<stdio.h>
#include<string.h>
#include<math.h>
struct student{
char name[20];
int height;
int money;
}stu[1000];
int main()
{
int i,n,j,k,m,l;
k=0;m=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s%d%d",&stu[i].name,&stu[i].height,&stu[i].money);

}
for(i=0;i<n;i++){

if(strcmp(stu[i].name,"Suxiao")==0)
j=stu[i].height;l=stu[i].money;
}
for(i=0;i<n;i++)
{
if(stu[i].height>j)
k++;
if(stu[i].money>l)
m++;
}
if(k<m)
printf("HEIGHT\n");
else if(k>m)
printf("MONEY\n");
else printf("EQ\n");
return 0;

}

Double click to view unformatted code.


Back to problem 63