【分析】
zcmu的wa为什么都是与不断输入有关的
找错找半天
以后还是不能直接看题解
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define maxn 1010
struct node{
char name[110];
int score;
int age;
}Student[maxn];
bool cmp(node a,node b)
{
if(a.score!=b.score)
return a.score<b.score;
else if(strcmp(a.name,b.name)!=0)
return strcmp(a.name,b.name)<0;
else
return a.age<b.age;
}
int main()
{
int t;
while(~scanf("%d",&t))
{
for(int i=0;i<t;i++)
{
//gets(Student[i].name);
scanf("%s %d%d",Student[i].name,&Student[i].age,&Student[i].score);
}
sort(Student,Student+t,cmp);
for(int i=0;i<t;i++)
{
//cin>>Student[i].name;
printf("%s %d %d\n",Student[i].name,Student[i].age,Student[i].score);
}
}
return 0;
}