Const n=4; m=3; var a:array[1..n,1..m] of integer; i,j,k:integer; begin k:=17; for j:=1 to m do begin if j mod 2 <> 0 then for i:=1 to n do begin k:=k-1; a[i,j]:=k; end else for i:=n downto 1 do begin k:=k-1; a[i,j]:=k; end; end; for i:=1 to n do begin for j:=1 to m do write(a[i,j]:4); writeln; end; end.
var a:array[1..n,1..m] of integer;
i,j,k:integer;
begin
k:=17;
for j:=1 to m do
begin
if j mod 2 <> 0
then for i:=1 to n do begin k:=k-1; a[i,j]:=k; end
else for i:=n downto 1 do begin k:=k-1; a[i,j]:=k; end;
end;
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]:4);
writeln;
end;
end.
Результат:
16 9 8
15 10 7
14 11 6
13 12 5