【分析】
理清关系就好
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define maxn 1000010
struct student{
char id[10];
char name[10];
int score;
}stu[maxn];
bool cmp1(student a,student b)
{
if(strcmp(a.id,b.id)!=0)
return strcmp(a.id,b.id)<0;
}
bool cmp2(student a,student b)
{
if(strcmp(a.name,b.name)!=0)
return strcmp(a.name,b.name)<0;
return strcmp(a.id,b.id)<0;
}
bool cmp3(student a,student b)
{
if(a.score!=b.score)
return a.score<b.score;
return strcmp(a.id,b.id)<0;
}
int main()
{
int t,c;
int k=1;
while(~scanf("%d%d",&t,&c)&&t!=0)
{
for(int i=0;i<t;i++)
{
scanf("%s %s %d",stu[i].id,s