张 张利中 Unregistered / Unconfirmed GUEST, unregistred user! 2007-06-06 #1 要求:数组为整型, 动态生成.即数组的个数由用户指定.每个数组的长度是确定的. 但数组名不同.如何编程实现生成指定个数的数组?
D d5love Unregistered / Unconfirmed GUEST, unregistred user! 2007-06-06 #2 二维数组就可以 var a : array of array of integer; setlength(a,用户指定长度,数组固定长度);
Y ysai Unregistered / Unconfirmed GUEST, unregistred user! 2007-06-07 #4 type TIntArray = array of integer; TDyArray = array of TIntArray; var a : TDyArray; begin SetLength(a, 3); SetLength(a[0], 4); SetLength(a[1], 5); SetLength(a[2], 6); end;
type TIntArray = array of integer; TDyArray = array of TIntArray; var a : TDyArray; begin SetLength(a, 3); SetLength(a[0], 4); SetLength(a[1], 5); SetLength(a[2], 6); end;
D d5love Unregistered / Unconfirmed GUEST, unregistred user! 2007-06-07 #5 var a : array of array of integer; i,j: integer; begin SetLength(a,用户指定长度); for i := Low(a) to High(a) do begin SetLength(a, 每个数组长度); for j:= Low(a) to High(a) do begin a[i,j] := 指定值; end; end; end;
var a : array of array of integer; i,j: integer; begin SetLength(a,用户指定长度); for i := Low(a) to High(a) do begin SetLength(a, 每个数组长度); for j:= Low(a) to High(a) do begin a[i,j] := 指定值; end; end; end;