Start: Jul, 10, 2019 08:30:00
2019年度暑期短学期达标测试补考
End: Jul, 10, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 3ms
Memory: 1120kB
Author: 2018212212288
In contest: 1284

#include<stdio.h>
#include<stdlib.h>
#define N 200
struct waihao{
	char name[30];
	int x;
};
int comp(const void *p,const void *q){
			return ((struct waihao *)q)->x-((struct waihao *)p)->x;
		}
int main(){
	struct waihao a[N];
	int x;
	char name;
	int t;
	int i;
	int b;
	scanf("%d",&t);
	while(t--){
		scanf("%d",&b);
		for(i=0;i<b;++i){
			scanf("%s%d",a[i].name ,&a[i].x );
	    }
		qsort(a,b,sizeof(struct waihao),comp);
		for(i=0;i<b;++i){
			printf("%s\n",a[i].name );
		}
	}
	return 0;
}