#include<bits/stdc++.h> using namespace std; #define max 100 struct student{ string name; int money; int height; }; int main(){ student stu[1010]; int n,m,h; scanf("%d",&n); for(int i = 0;i<n;i++){ cin>>stu[i].name>>stu[i].height>>stu[i].money; if(stu[i].name == "Suxiao"){ m = stu[i].money; h = stu[i].height; } } int PM = 0,MM = 0; for(int i = 0;i < n;i++){ if( m > stu[i].money && stu[i].name!="Suxiao")PM++; } for(int i = 0;i < n;i++){ if( h > stu[i].height && stu[i].name!="Suxiao")MM++; } if(MM == PM)cout<<"EQ"; else if(PM > MM) cout<<"MONEY"; else cout<<"HEIGHT"; return 0; } |
Double click to view unformatted code.