Pro.ID21722 TitleMP3 SONGS Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21722 AC0 Submit0 Ratio- 时间&空间限制描述Sue loves her mp3 player but she hates the fact that her shuffle mode plays her tracks randomly. Because she loves order and patterns she would like the tunes on her mp3 player to be played in alphabetical order. In this problem you have to help Sue by sorting her tunes into alphabetical order of tune name.
Input consists of a number of scenarios, each beginning with a single positive integer, n, the number of music tracks that require sorting (1 < n <= 200). The last line of input is a single 0 ? this scenario should not be processed. 输入Each scenario consists of n lines, each line containing a tune name. No line will contain more than 250 characters. Each name will begin with an alphabetic character. 输出Description Sue loves her mp3 player but she hates the fact that her shuffle mode plays her tracks randomly. Because she loves order and patterns she would like the tunes on her mp3 player to be played in alphabetical order. In this problem you have to help Sue by sorting her tunes into alphabetical order of tune name.
Input consists of a number of scenarios, each beginning with a single positive integer, n, the number of music tracks that require sorting (1 < n <= 200). The last line of input is a single 0 ? this scenario should not be processed. Input Each scenario consists of n lines, each line containing a tune name. No line will contain more than 250 characters. Each name will begin with an alphabetic character. Output Output will consist of the scenario number, the first being 1, on a line on its own. This will be followed by n lines showing the tune names from the input list, sorted in alphabetical order, one name per line. Case should be ignored. Sample Input 10
Forever
Take A Bow
Always On My Mind
Lollipop
Love In This Club
No Air
Sweet About Me
Party People
Mercy
American Boy
8
Partita
Air on a 'G' string
Sinfonia in D
Jesu, joy of man's desiring
Arioso
Violin Concerto in A Minor
Brandenburg Concerto 2
Concerto for 2 violins
0 Sample Output 1
Always On My Mind
American Boy
Forever
Lollipop
Love In This Club
Mercy
No Air
Party People
Sweet About Me
Take A Bow
2
Air on a 'G' string
Arioso
Brandenburg Concerto 2
Concerto for 2 violins
Jesu, joy of man's desiring
Partita
Sinfonia in D
Violin Concerto in A Minor Source 样例输入10
Forever
Take A Bow
Always On My Mind
Lollipop
Love In This Club
No Air
Sweet About Me
Party People
Mercy
American Boy
8
Partita
Air on a 'G' string
Sinfonia in D
Jesu, joy of man's desiring
Arioso
Violin Concerto in A Minor
Brandenburg Concerto 2
Concerto for 2 violins
0 样例输出1
Always On My Mind
American Boy
Forever
Lollipop
Love In This Club
Mercy
No Air
Party People
Sweet About Me
Take A Bow
2
Air on a 'G' string
Arioso
Brandenburg Concerto 2
Concerto for 2 violins
Jesu, joy of man's desiring
Partita
Sinfonia in D
Violin Concerto in A Minor 作者 |