把数组从小往大按升序排列。下面是伪代码。
for i = 1 to n do for j = 1 to n do if A[i] < A[j] then swap A[i] and A[j]
这段代码完全符合结果。