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

PROGRAMMING:Exchange maximum decimal position

Luz5年前 (2021-05-10)题库379
Enter n (1 < = n < = 20) integers with no more than 2 bits, and exchange the smallest number with the first one, and exchange the largest number with the last one.
###Input format:
There are several groups of test data, which are processed to the end of the file. Input n (1 < = n < = 20) in the first line of each group of test data.
In the second line, enter n integers with no more than 2 bits.
###Output format:
Each group outputs the N integers after the minimum number is exchanged with the first number, and the maximum number is exchanged with the last number.
###Input example:
Here is a set of inputs. For example:
```in
ten
-28 -46 -27 -98 7 60 -13 -92 91 -61
fifteen
85 32 36 -26 15 -81 11 -91 4 55 40 48 69 7 33
```
###Output example:
The corresponding output is given here. For example:
```out
-98 -46 -27 -28 7 60 -13 -92 -61 91
-91 32 36 -26 15 -81 11 33 4 55 40 48 69 7 85
```







answer:If there is no answer, please comment