冒泡排序的另一种写法
var arr:array[0..5] of integer; i,j:integer; itemp:integer; begin arr[0]:=1; arr[1]:=71; arr[2]:=5; arr[3]:=31; arr[4]:=2; arr[5]:=12; for i:=0 to 5 do for j:=0 to 4-i do begin itemp:=arr[j]; if itemp<arr[j+1] then begin arr[j]:= arr[j+1]; arr[j+1]:=itemp; end; end; for i:= 0 to 5 do memo1.Lines.Add(inttostr(arr[i])); end;