View Code of Problem 63

#include<iostream>
#include<string>

using namespace std;

int main()
{
    int high[10000],money[10000];
    int N,temp,rand_high=0,rand_money=0;string str;
    cin>>N;
    for(int i=0;i<N;i++)
    {
        cin>>str>>high[i]>>money[i];
        if(str=="Suxiao")
            temp=i;
    }
    for(int i=0;i<N;i++)
    {
        if(high[i]<high[temp])
            rand_high++;
        if(money[i]<money[temp])
            rand_money++;
    }
    if(rand_high>rand_money)
        cout<<"HEIGHT";
    else if(rand_high<rand_money)
        cout<<"MONEY";
    else
        cout<<"EQ";
    return 0;
}

Double click to view unformatted code.


Back to problem 63