Pascal 运行时错误 216,$004014AD

Pascal Runtime error 216 at $004014AD

const
  SIZE = 100000;

var
  n, i, j: LongInt;
  a: array[1..SIZE, 1..SIZE] of Integer;
begin
  Read(n);

  for i:= 1 to n do
    for j:= 1 to n do;
      a[i][j]:= 0;
end.

您的代码中有两个错误。 我假设您永远不会在命令行上输入 100000 个值:-) 我将此值更改为更现实的值(不会占用太多内存...)

const
  SIZE = 100;

var
  n, i, j: integer;
  a: array[1..SIZE, 1..SIZE] of Integer;
begin
  Read(n);

  for i:= 1 to n do
    for j:= 1 to n do // here you had a semicolon!
      a[i][j]:= 0;
end.

除此之外,您的代码没有任何用处。它只是将 0 分配给数组并退出。

您还应该检查您的输入 (n) 是否超过数组的最大大小 (n>SIZE)