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: 2018212212226
In contest: 1284

#include<stdio.h>
#include<stdlib.h>
struct loy{
	char name[20];
	double num;
};
int comp(const void *p,const void *q){
	return((struct loy *)q)->num-((struct loy *)p)->num;
}
int main()
{
	struct loy x[1000];
	int  T;
	scanf("%d",&T);
	while(T--){
		int n,i,j,t;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%s %lf",x[i].name,&x[i].num);
		}
		qsort(x,n,sizeof(struct loy),comp);
		for(i=0;i<n;i++){
			printf("%s\n",x[i].name);
		}
	}
}