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