View Code of Problem 63

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
    int N;
    cin>>N;
//    while(N--){
        string name;
        int h[999],m[999],p=0,q=0,a=0,b=0;
        for(int i=0;i<N;i++){
            cin>>name>>h[i]>>m[i];
            if(name=="Suxiao"){
                p=h[i];
                q=m[i];
            }
        }
//        for(int i=0;i<N;i++){
    
//        }
//        cout<<p<<"   "<<q<<endl;
        for(int i=0;i<N;i++){
            if(h[i]>p)
                a++;
            if(m[i]>q)
                b++;
        }
        if(a<b)
            cout<<"HEIGHT"<<endl;
        if(a>b)
            cout<<"MONEY"<<endl;
        if(a==b)
            cout<<"EQ"<<endl;
//    }
    return 0;
}

Double click to view unformatted code.


Back to problem 63