PROGRAMMING:Sorting by function selection
Enter a positive integer repeat (0 < repeat < 10) and perform the following operations:
Input a positive integer n (1 < n < = 10), then input n integers into array a, arrange the elements in array a in ascending order by selection method, and finally output the sorted array elements.
It is required to define and call the function sort (a, n). Its function is to sort the first n elements of array a from small to large by using the sorting algorithm. The type of function parameter a is integer pointer, the type of parameter n is int, and the type of function is void.
Output format: the data is directly separated by spaces, and there is no space after the last data.
Input and output example: description in brackets, no input and output required
###Input example:
```in
3 (repeat=3)
4 (n=4)
5 1 7 6
3 (n=3)
1 2 3
5 (n=5)
5 4 3 2 1
```
###Output example:
```out
After sorted: 1 5 6 7
After sorted: 1 2 3
After sorted: 1 2 3 4 5
```
answer:If there is no answer, please comment
Input a positive integer n (1 < n < = 10), then input n integers into array a, arrange the elements in array a in ascending order by selection method, and finally output the sorted array elements.
It is required to define and call the function sort (a, n). Its function is to sort the first n elements of array a from small to large by using the sorting algorithm. The type of function parameter a is integer pointer, the type of parameter n is int, and the type of function is void.
Output format: the data is directly separated by spaces, and there is no space after the last data.
Input and output example: description in brackets, no input and output required
###Input example:
```in
3 (repeat=3)
4 (n=4)
5 1 7 6
3 (n=3)
1 2 3
5 (n=5)
5 4 3 2 1
```
###Output example:
```out
After sorted: 1 5 6 7
After sorted: 1 2 3
After sorted: 1 2 3 4 5
```
answer:If there is no answer, please comment