Const n = 4; m = 5; var i, j, k: integer; a: array [1 .. n, 1 .. m] of integer; begin i := 1; for j := 1 to 5 do a[i, j] := j; k := 0; for i := 3 to n + 1 do begin for j := 1 to m do begin k := (i - 1) * m + j; a[i - 1, j] := k; end; end; for i := 1 to n do begin for j := 1 to m do write(a[i, j]:4); writeln; end; readln; end.
n = 4;
m = 5;
var
i, j, k: integer;
a: array [1 .. n, 1 .. m] of integer;
begin
i := 1;
for j := 1 to 5 do a[i, j] := j;
k := 0;
for i := 3 to n + 1 do
begin
for j := 1 to m do
begin
k := (i - 1) * m + j;
a[i - 1, j] := k;
end;
end;
for i := 1 to n do
begin
for j := 1 to m do
write(a[i, j]:4);
writeln;
end;
readln;
end.