Y yhwyb Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-13 #1 如题,十个整数,每一个在1000以内,请高手帮一下,谢谢 刚才发到非技术问题里,没人理我,现在再发一次
C creation-zy Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-13 #2 procedure fSort(var inX:array of integer); var temp:integer; i,j,n:integer; flag:boolean; Begin n:=high(inX); for i := 1 to n do For j:=LOW(inX) to n-i do IF inX[j+1]<inX[j] Then Begin temp:=inX[j]; inX[j]:=inX[j+1]; inX[j+1]:=temp; end ; end; 冒泡排序,原理见 http://www.delphibbs.com/delphibbs/dispq.asp?lid=1576037
procedure fSort(var inX:array of integer); var temp:integer; i,j,n:integer; flag:boolean; Begin n:=high(inX); for i := 1 to n do For j:=LOW(inX) to n-i do IF inX[j+1]<inX[j] Then Begin temp:=inX[j]; inX[j]:=inX[j+1]; inX[j+1]:=temp; end ; end; 冒泡排序,原理见 http://www.delphibbs.com/delphibbs/dispq.asp?lid=1576037
Y yhwyb Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-13 #3 谢谢了,我马上验证,先给你分,另:在非技术问题里,你也去回答,我再给你分