View Code of Problem 63

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    int height[n], money[n], sxNum, heightLevel = 0, moneyLevel = 0;
    string name;
    for(int i = 0; i < n; i++){
        cin >> name >> height[i] >> money[i];
        if(name == "Suxiao")
            sxNum = i;
    }
    for(int i = 0; i < n; i++){
        if(height[sxNum] > height[i])
            heightLevel++;
        if(money[sxNum] > money[i])
            moneyLevel++;
    }
    if(heightLevel > moneyLevel)
        cout << "HEIGHT" << endl;
    else if(heightLevel < moneyLevel)
        cout << "MONEY" << endl;
    else
        cout << "EQ" << endl;
    return 0;
}

Double click to view unformatted code.


Back to problem 63