View Code of Problem 63

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n;
    scanf("%d",&n);
    int m[n],h[n],index;
    for(int i = 0;i <n;i++){
        char name[25];
        scanf("%s %d %d",name,&h[i],&m[i]);
        if(strcmp(name,"Suxiao") == 0){
            index = i;
        }
    }
    int hl=1,ml =1;
    for(int i= 0;i <n;i++){
        if(h[i] > h[index]){
            hl++;
        }
        if(m[i]> m[index]){
            ml++;
        }
    }

    if(hl ==ml){
        printf("EQ");
    }
    else if(hl < ml){
        printf("HEIGHT");
    }
    else{
        printf("MONEY");
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 63