#include<stdio.h> #include<string.h> struct student{ char name[20]; int money; int height; }; int main(){ int n; int t; int s=0; int m=0; scanf("%d",&n); struct student stu[1000]; for(int i=0;i<n;i++){ scanf("%s %d %d",&stu[i].name,&stu[i].height,&stu[i].money); } for(int i=0;i<n;i++){ if(strcmp(stu[i].name,"Suxiao")==0){//找到suxiao 的位置 t=i; } } for(int i=0;i<n;i++){ if(stu[t].height<stu[i].height){ s++; } if(stu[t].money<stu[i].money){ m++; } } if(s==m){ printf("EQ"); }else if(s<m){ printf("HEIGHT"); }else{ printf("MONEY"); } return 0; } |
Double click to view unformatted code.