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

PROGRAMMING:Bubble sort of string

Luz5年前 (2021-05-10)题库463
We already know the bubble sort method of sorting $$n $$integers from small to large. This problem requires that this method be used for string sequence, and for any given $$k $$($$< n $$), output the intermediate result sequence after the scanning of the $$k $$.
###Input format:
Enter $$n $$and $$k $$($$1 / Le K < n / Le 100 $$) in the first line. After that, $$n $$lines, each line contains a non empty string with a length of no more than 10 and only composed of lowercase English letters.
###Output format:
Output bubble sort method scans the intermediate result sequence after the $$k $$pass, each line contains a string.
###Input example:
```in
6 2
best
cat
east
a
free
day
```
###Output example:
```out
best
a
cat
day
east
free
```






answer:If there is no answer, please comment