View Code of Problem 63

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include<math.h>
void main() {
	int n;
	int money[1000],height[1000];int smon, shgt;
	char name[100];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s", &name);
		
		scanf("%d", &height[n]);
		scanf("%d", &money[n]);
		if (strcmp(name, "Suxiao") == 0) {
			shgt = height[n];
			smon = money[n];
		}
	}
	int numM = 1,numH = 1;
	
	for (int i = 0; i < n; i++) {
		if (height[n] > shgt) {
			numH++;
		}
		if (money[n] > smon) {
			numM++;
		}
	}
	if (numH > numM) {
		printf("HEIGHT\n");
	}
	else if (numH == numM) {
		printf("EQ\n");
	}
	else {
		printf("MONEY\n");
	}

}

Double click to view unformatted code.


Back to problem 63