View Code of Problem 63

//身高优势
#include<stdio.h>
#include<math.h>
#include<string.h>
struct h{
	char name[30];
	int h;
	int m;
};
int main(){
	int n;
	scanf("%d",&n);
	struct h s[1000];
	int h1,m1;
	int i;
	int a=1;
	int b=1;
	for(i=0;i<n;i++){
		scanf("%s %d %d",&s[i].name,&s[i].h,&s[i].m);
	}
	for(i=0;i<n;i++){//找出这个同学 
		if(strcmp(s[i].name,"Suxiao")==0){
			h1=s[i].h;//身高 
			m1=s[i].m;//钱 
		}
	}
	for(i=0;i<n;i++){
		if(s[i].h>h1){
			a++;
		}
	}
	for(i=0;i<n;i++){
		if(s[i].m>m1){
			b++;
		}
	}
	if(a>b){
		printf("MONEY\n");
	}else if(a<b){
		printf("HEIGHT\n");
	}else{
		printf("EQ\n");
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 63