BestCoder Round #54 (div.2) HDU 5427 A problem of sorting(1001)

1001 ( HDU 5427 ) A problem of sorting

 Time Limit: 2000/1000 MS (Java/Others)
 
 Memory Limit: 65536/65536 K (Java/Others)
問題描述
給出一張許多人的年齡和生日表。你需要從年輕到年老輸出人們的名字。(沒有人年齡相同)
輸入描述
第一行包含一個正整數T(T \leq 5)T(T5),表示數據組數。
對於每組數據,第一行包含一個正整數n(1 \leq n \leq 100)n(1n100),表示人數,接下來n行,每行包含一個姓名和生日年份(1900-2015),用一個空格隔開。姓名長度大於0且不大於100。注意姓名中只包含字母,數字和空格。
輸出描述
對於每組數據,輸出nn行姓名。
輸入樣例
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;
}



發佈了19 篇原創文章 · 獲贊 4 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章