View Code of Problem 63

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		S[] students = new S[n];
		int k = 0, numHeight = 1,numMoney = 1;
		for(int i = 0;i < n;i++) {
			students[i] = new S();
			students[i].name = scanner.next();
			students[i].height = scanner.nextInt();
			students[i].money = scanner.nextInt();
			if(students[i].name.equals("Suxiao")) {
				k = i;
			}
		}
		for(int i = 0;i < n;i++) {
			if(students[k].height < students[i].height) {
				numHeight++;
			}
			if(students[k].money < students[i].money) {
				numMoney++;
			}
		}
		if(numHeight == numMoney) {
			System.out.println("EQ");
		}
	    if(numHeight < numMoney) {
			System.out.println("HEIGHT");
		}
	    if(numHeight > numMoney) {
	    	System.out.println("MONEY");
	    }
		
	}
}
class S{
	String name;
	int height;
	int money;
}

Double click to view unformatted code.


Back to problem 63