Description
請撰寫一支程式,讓使用者輸入一串數列後使用選擇排序來將數列由小排到大。
Please write a program that allows the user to input a sequence of numbers and then use selection sort to sort the sequence from small to large.
Input
輸入包含以下兩行:
第一行包含一個正整數n(8≤n≤20),代表數列長度。
�(8≤�≤20)
第二行包含n個正整數,代表使用者輸入的數列元素。
�
The input contains the following two lines:
The first line contains a positive integer n, representing the length of the sequence.
�
The second line contains n positive integers, representing the sequence elements entered by the user.
�
Output
請將數列由小排到大輸出。
Please sort the sequence from small to large for output.
Sample Input 1
8
39 52 25 28 25 19 70 70
Sample Output 1
19 25 25 28 39 52 70 70
Sample Input 2
9
64 33 4 7 40 25 87 20 47
Sample Output 2