#include #include #define M 100000 #include struct ln{ int xuehao; char name[10]; int score; }; struct ln a[M+10]; int cmpx(const void *a,const void *b){ return (*(ln*)a).xuehao-(*(ln*)b).xuehao; } int cmpn(const void *a,const void *b){ ln *c=(ln*)a; ln *d=(ln *)b; if(!strcmp(c->name,d->name)) return c->xuehao-d->xuehao; else return strcmp(c->name,d->name); } int cmps(const void *a,const void *b){ ln *c=(ln*)a; ln *d=(ln *)b; if(c->score==d->score) return c->xuehao-d->xuehao; else return c->score-d->score; } int main(){ int n,c; int i; int t=0; while(scanf("%d%d",&n,&c)&&n){ t++; for(i=0;i