just sort the array in descending order, then put it out .



selection_sort(10, a[i]);


it is wrong when you call selection_sort like this. the sec arg of this function is "int *"