#include<stdio.h> #include<algorithm> #include<cstring> using namespace std; struct student{ char name[25]; int height; int money; }; bool cmp(student a,student b){ return a.height>b.height; } bool cmp2(student a,student b){ return a.money>b.money; } int main(){ int n; scanf("%d",&n); getchar(); student s[n],s2[n]; int i; for(i=0;i<n;i++){ scanf("%s %d %d",s[i].name,&s[i].height,&s[i].money); strcpy(s2[i].name,s[i].name); s2[i].height=s[i].height; s2[i].money=s[i].money; } sort(s,s+n,cmp); sort(s2,s2+n,cmp2); int a,b; for(i=0;i<n;i++){ if(strcmp(s[i].name, "Suxiao")==0){ a=i; break; } } for(i=0;i<n;i++){ if(strcmp(s[i].name, "Suxiao")==0){ b=i; break; } } if(a>b){ printf("HEIGHT\n"); } else if(a<b){ printf("MONET\n"); } else{ printf("EQ\n"); } return 0; } |
Double click to view unformatted code.