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

PROGRAMMING:One dimensional array Max and min swapping

Luz5年前 (2021-05-10)题库422
Find out the maximum and minimum values in the one-dimensional array with 10 elements, and swap the positions of the two numbers.
###Input format:
Enter 10 integers in a row, and only one space can be used between the data.
###Output format:
In a row, the output results are in the format of "max = maximum, min = minimum". The maximum and minimum values are output as is, without column width control.
In the next row, output the one-dimensional array with the maximum and minimum values exchanged, and each data output occupies 5 columns.
###Input example:
```in
6 5 1 2 3 4 8 9 7 5
```
###Output example:
```out
max=9,min=1
6 5 9 2 3 4 8 1 7 5
```






answer:If there is no answer, please comment