1001 ( HDU 5427 ) A problem of sorting
給出一張許多人的年齡和生日表。你需要從年輕到年老輸出人們的名字。(沒有人年齡相同)
第一行包含一個正整數T(T≤5),表示數據組數。 對於每組數據,第一行包含一個正整數n(1≤n≤100),表示人數,接下來n行,每行包含一個姓名和生日年份(1900-2015),用一個空格隔開。姓名長度大於0且不大於100。注意姓名中只包含字母,數字和空格。
對於每組數據,輸出n行姓名。
2 1 FancyCoder 1996 2 FancyCoder 1996 xyz111 1997
FancyCoder xyz111 FancyCoder
注意:姓名中只包含字母,數字和空格。
/*
Problem : HDU5427 ( A problem of sorting )
Exe.Time 0MS Code Len. 1008 B
Exe.Memory 1600K Language G++
*/
#include
#include
#include
using namespace std;
int main()
{
int a[200];
char b[200];
int n,t,k,i,j,len;
char bb[200][200];
scanf("%d",&t);
while(t--)
{
memset(a,0,sizeof(a));
scanf("%d",&n);
getchar();
j=0;
for(i=0;i=0;i--)
{
if(a[i])
{
for(j=0;bb[i][j]!='\0';j++)
{
printf("%c",bb[i][j]);
}
printf("\n");
}
}
}
return 0;
}