简单题
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
#define MAXN 1000+5
struct student{
char name[101];
int age;
int score;
}stus[MAXN];
bool cmp(student A,student B){
if(A.score!=B.score)return A.score < B.score;
int t = strcmp(A.name,B.name);
if(t!=0)return t<0;
return A.age<B.age;
}
int main(){
int N;
while(~scanf("%d",&N)){
for(int i = 0; i < N; ++i)scanf("%s %d %d",stus[i].name,&stus[i].age,&stus[i].score);
sort(stus,stus+N,cmp);
for(int i = 0; i < N; ++i)
printf("%s %d %d\n",stus[i].name,stus[i].age,stus[i].score);
}
return 0;
}