-->
当前位置:首页 > 题库

PROGRAMMING:Output bubble sort process

Luz5年前 (2021-05-10)题库406
Input n (1 ≤ n ≤ 10) integers, and sort them from small to large by bubble sorting method, with a total of n-1 times, and output the sorting situation of each time.
###Input format:
First enter the number n, and then enter n integers.
###Output format:
Results of the first trip
Results of the second trip
......
The result of n-1
Each number is followed by a space, and each sequence takes up one line.
###Input example:
```in
five
4 2 3 2 1
```
###Output example:
```out
2 3 2 1 4
2 2 1 3 4
2 1 2 3 4
1 2 2 3 4
```







answer:If there is no answer, please comment