#include<stdio.h> #include<string.h> #include<math.h> typedef struct { char name[20]; int h,m; }stu; int main() { stu s[1000]; int n,i; int temp1,temp2; int rank1=0,rank2=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s %d %d",s[i].name,&s[i].h,&s[i].m); if(strcmp(s[i].name,"Suxiao")==0 ) { temp1=s[i].h; temp2=s[i].m; } } for(i=0;i<n;i++) { if(s[i].h>temp1) { rank1++; } if(s[i].m>temp2) { rank2++; } } if(rank1>rank2) { printf("MONEY\n"); } if(rank1==rank2) { printf("EQ\n"); } if(rank1<rank2) { printf("HEIGHT\n"); } } |
Double click to view unformatted code.