1) var A: array [1..7,1..9] of integer;
var i,j,k,n:integer;
var Sr: double;
begin
randomize;
writeln ('Массив случайных чисел');
for i:=1 to 7 do
begin
for j:=1 to 9 do begin
A[i,j]:= random (56) + 25;
write (A[i,j]:4);
end;
writeln;
end;
for i:=1 to 7 do
begin
for j:=1 to 9 do
begin
If A[i,j] mod 2 = 0 then
begin
Sr:= Sr + A[i,j];
k:= k + 1;
end
else n:= n + 1;
end;
end;
Sr:= Sr / k;
Writeln ('Среднее арифмитическое четных элементов: ', Sr);
Writeln ('Количество нечетных элементов: ', n);
end.
2)const n = 5;
const b = 5;
var A: array [1..n,1..b] of integer;
var i,j:integer;
begin
writeln ('Введите массив');
for i:=1 to n do
begin
for j:=1 to b do begin
Read (A[i,j]);
end;
end;
for i:=1 to n do
begin
for j:=1 to b do begin
If A[i,j] < 0 then
A[i,j]:= 1;
write (A [i,j]:4);
end;
Writeln;
end;
end.