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;
}

浙公网安备 33010602011771号