View Code of Problem 63

#include<stdio.h>
#include<string.h>
struct student{
char name[20];
int height;
int money;
}stu[10];
int main()
{
int i,n,j,k,m;
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=i;
}
for(i=0;i<n;i++)
{
if(stu[i].height>stu[j].height)
k++;
if(stu[i].money>stu[j].money)
m++;
}
if(k<m)
printf("HEIGHT");
else if (k>m)
printf("MONEY");
else printf("EQ");
return 0;

}

Double click to view unformatted code.


Back to problem 63