题目: |
program xx302;
const
a:array[1..6] of integer=(3,2,4,6,5,1);
var
b:array[1..6] of integer;
i,j,k:integer;
begin
b:=a;
for i:=1 to 3 do
for j:=i+1 to 6 do
if b[i]<b[j] then begin
k:=b[i];b[i]:=b[j];b[j]:=k end;
for i:=1 to 6 do
write(b[i]:3);
end. 输出: 6 5 4 2 3 1
|