1110:小白鼠排队

#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
typedef struct  
{
	int weight;
	char hat[101];
}mouse;
int cmp(mouse a,mouse b)
{
	return a.weight>b.weight;
}
int main()
{
	int n;
	mouse m[101];
	while(scanf("%d",&n)!=EOF)
	{
		int i;
		for(i=0;i<n;++i)
			scanf("%d%s",&m[i].weight,m[i].hat);
		sort(m,m+n,cmp);
		for(i=0;i<n;++i)
		{
			printf("%s\n",m[i].hat);
		}
	}
	return 0;
}

 

posted @ 2012-04-16 17:35  dupuleng  阅读(118)  评论(0)    收藏  举报