View Code of Problem 63

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;

typedef struct student{
	char name[25];
	int height;
	int money;
} stu;
int main(){
	
	int N;
	int k;
	int x,y;
	scanf("%d", &N);
	student stu[N];
	getchar();
	for( int i=0; i<N; i++ ){
		scanf("%s%d%d", &stu[i].name, &stu[i].height, &stu[i].money);
		if( strcmp(stu[i].name, "Suxiao")){
			k = i;
		}
	}
	x = y = 0;
	for( int i=0; i<N; i++ ){
		if( stu[i].height < stu[k].height){
			x ++;
		}
		if( stu[i].money < stu[k].money ){
			y++;
		}
	}
	if( x>y ){
		printf("HEIGHT\n");
	}else if( x<y ){
		printf("MONEY\n");
	}else{
		printf("EQ\n");
	}
	
	

	return 0;
	
}

Double click to view unformatted code.


Back to problem 63