View Code of Problem 63

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
	int n,i,s,s1,max,max1,t;
	scanf("%d",&n);
	char na[1000];
	int h[1000];
	int m[1000];
	for(i=0;i<n;i++){
		scanf("%s %d %d",&na[i],&h[i],&m[i]);
	}
	max=h[0];
	max1=m[0];
	s=0;
	t=0;
	for(i=0;i<n;i++){
		if(max<h[i]){
			max=h[i];
			s=i;
		}
		if(max1<m[i]){
			max1=m[i];
			s1=i;
		}
	}
	for(i=0;i<n;i++){
		if(na[i]=='Suxiao'){
			t=i;
		}
	}
	if(t==s){
		printf("HEIGHT");
	}
	else if(t==s1){
		printf("MONEY");
	}
	else
		printf("EQ");
}

Double click to view unformatted code.


Back to problem 63