Ответ:
pascal
Объяснение:
var
m, n, i, j, k: integer;
rev: boolean;
a: array[,] of integer;
begin
Write('Введите размер матрицы M и N:'); ReadLn(m, n);
SetLength(a, m, n);
k := 1;
for i := 0 to m - 1 do
if rev then for j := n - 1 downto 0 do
a[i, j] := k; inc(k);
end
else for j := 0 to n - 1 do
end;
rev := not rev;
for j := 0 to n - 1 do
Write(a[i, j]:4);
WriteLn;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
pascal
Объяснение:
var
m, n, i, j, k: integer;
rev: boolean;
a: array[,] of integer;
begin
Write('Введите размер матрицы M и N:'); ReadLn(m, n);
SetLength(a, m, n);
k := 1;
for i := 0 to m - 1 do
begin
if rev then for j := n - 1 downto 0 do
begin
a[i, j] := k; inc(k);
end
else for j := 0 to n - 1 do
begin
a[i, j] := k; inc(k);
end;
rev := not rev;
end;
for i := 0 to m - 1 do
begin
for j := 0 to n - 1 do
Write(a[i, j]:4);
WriteLn;
end;
end.