clear;clc
%************選擇法排序開始**************
A = [6 7 9 0 4 9 3 3 9 5];
n = length(A)
for i = 1:n %定值
for j = i:n %查找最小值
if A(i)>A(j) %交換
t = A(i);
A(i) = A(j);
A(j) = t;
end
end
end
A
選擇法排序
最新推荐文章于 2022-04-12 09:00:18 发布