View Code of Problem 63

#include <bits/stdc++.h>
using namespace std;
typedef struct{
	string name;
	int height;
	int money;
}student;
int main(){
	int n;	
	cin>>n;
	student stu[n];
	int h,m;
	for(int i=0;i<n;i++){
		cin>>stu[i].name>>stu[i].height>>stu[i].money;
		if(stu[i].name=="Suxiao") h=stu[i].height,m=stu[i].money;
	}
	int count1=1,count2=1;
	for(int i=0;i<n;i++){
		if(stu[i].height>h) count1++;
		if(stu[i].money>m) count2++;
	}
	if(count1<count2) cout<<"HEIGHT"<<endl;
	else if(count1==count2) cout<<"EQ"<<endl;
	else cout<<"MONEY"<<endl;
} 

Double click to view unformatted code.


Back to problem 63