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 count = scanner.nextInt();
		Student[] s = new Student[count];
		int k=0;
		for(int i=0;i<count;i++) {
			s[i] = new Student(scanner.next(), scanner.nextInt(), scanner.nextInt());
			if(s[i].name.equals("Suxiao")) {
				k=i;
			}
		}
		int m=0,h=0;
		for(int i=0;i<count;i++) {
			if(s[i].money<s[k].money) {
				m++;
			}
			if(s[i].height<s[k].height) {
				h++;
			}
		}
		if(h==m) {
			System.out.println("EQ");
		}else if(h>m) {
			System.out.println("HEIGHT");
		}else {
			System.out.println("MONEY");
		}
		
		scanner.close();
	}
}
class Student{
	String name;
	int height;
	int money;
	public Student(String name, int height, int money) {
		super();
		this.name = name;
		this.height = height;
		this.money = money;
	}
	
}

Double click to view unformatted code.


Back to problem 63