First, scan from one direction based on one element, for example, from left to right based on A[0].
Next, find the smallest element from A[0], …, A[9] and exchange it with A[0].
Then move the reference position to the right by one position and repeat the above actions. For example, based on A[ 1], find the minimum value of A[ 1]~A[9] and exchange it with A[ 1].
Until the benchmark position moves to the last element of the array, the sorting ends (at this time, all elements on the left of the benchmark increase in turn, and the benchmark is the last element, and the sorting is completed).
Master ()
Int array [10]; ?
//Initialize the array!
int i,j,k,temp?
for(I = 0; I< 10- 1; i++) {
k = I; ?
for(j = I+ 1; j & lt 10; j++)
if(array[j]& lt; array[k])k = " j "; = " " temp = " array[k]; Array[k]= array; array = temp"}="" }