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