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

PROGRAMMING:A number is inserted into an ordered sequence

Luz5年前 (2021-05-10)题库434
Use the insertion method to sort, assuming that N data of X array have been arranged in descending order, now insert a number y into the array, so that the array x is still arranged in descending order.
###Input format:
Enter a positive integer n in the first line.
In the second line, enter n descending integers separated by spaces. Only one space can be used between data.
In the third line, enter an integer y to be inserted.
All data are positive integers within 100.
###Output format:
Output the ordered array after y is inserted in one row, and each data output occupies 3 columns.
###Input example:
```in
five
7 6 3 2 1
four
```
###Output example:
```out
7 6 4 3 2 1
```






answer:If there is no answer, please comment