#include<stdio.h> #include<string.h> typedef struct student { char name[20]; int height; int money; }student; int main() { student stu[1000]; int n,h=0,m=0; scanf("%d",&n); int i,j,k; 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 ) { j = i; } } for(k=0;k<n;k++) { if(stu[k].money>stu[j].money) m++; if(stu[k].height>stu[j].height) h++; } if(m>h) { printf("HEIGHT"); } else if(m==h) { printf("EQ"); } else if(m<h) { printf("MONEY"); } return 0; } |
Double click to view unformatted code.