const
N = 5;
k = 2;
var
matrix: array[1..N, 1..N] of integer;
i, j: integer;
begin
for i := 1 to N do
for j := 1 to N do
matrix[i, j] := random(100);
write(matrix[i, j]:4);
writeln;
end;
writeln('Элементы главной диагонали разделенные на ', k, ':');
write(matrix[i, i] / k:0:2, ' ');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const
N = 5;
k = 2;
var
matrix: array[1..N, 1..N] of integer;
i, j: integer;
begin
for i := 1 to N do
for j := 1 to N do
matrix[i, j] := random(100);
for i := 1 to N do
begin
for j := 1 to N do
write(matrix[i, j]:4);
writeln;
end;
writeln('Элементы главной диагонали разделенные на ', k, ':');
for i := 1 to N do
write(matrix[i, i] / k:0:2, ' ');
end.