min = i
j = i + 1
Do While j <= 6
If a(j) < a(min) Then min = j
j = j + 1
Loop
If i<>min Then tmp = a(i): a(i) = a(min): a(min) = tmp
i = i + 1