View Code of Problem 63

#include <stdio.h>
#include <string.h>

typedef struct student{
	char name[32];
	int height;
	int money;
}stu;

int main(){
	int n;
	int i;
	scanf("%d",&n);
	stu a[n];
	int money=1,height=1;
	int index;
	for(i=0;i<n;i++){
		scanf("%s %d %d",&a[i].name,&a[i].height,&a[i].money);
		if(strcmp(a[i].name,"Suxiao")==0){	//
			index=i;						//
		}
	}
	
	for(i=0;i<n;i++){
		if(i!=index){	//
			if(a[i].height>a[index].height){
				height++;
			}
			if(a[i].money>a[index].money){
				money++;
			}
		}
	}
	
	if(money==height){
		printf("EQ\n");
	}
	
	if(money<height){
		printf("MONEY\n");
	}
	if(height<money){
		printf("HEIGHT\n");
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 63