主题:一个pascal的简单问题。
这学期刚开始学pascal,下面是用二维数组输出下三角的九九乘表
var
A: array of array of integer;
I,J: integer;
begin
{ TDO -oUser -cConsole Main : Insert code here }
setlength(a,9);
for I:=low(A) to high(A) do
begin
setlength(A[I],I+1);//同c语言
for J := low(A[I]) to high(A[I]) do
begin
A[I,J] := (I+1)*(J+1);
write(A[I,J]:3);
end;
writeln;
end;
readln;
end.
我想问一下,为什么只有写了readln才能输出,不写就报错阿??
var
A: array of array of integer;
I,J: integer;
begin
{ TDO -oUser -cConsole Main : Insert code here }
setlength(a,9);
for I:=low(A) to high(A) do
begin
setlength(A[I],I+1);//同c语言
for J := low(A[I]) to high(A[I]) do
begin
A[I,J] := (I+1)*(J+1);
write(A[I,J]:3);
end;
writeln;
end;
readln;
end.
我想问一下,为什么只有写了readln才能输出,不写就报错阿??