var
A: array [1..5] of Integer;
i, p: Integer;
begin
WriteLn ('Массив:');
p := 1;
Randomize;
for i := 1 to 5 do begin
A [i] := Random (10);
WriteLn (i, ': ', A [i]);
if i mod 2 = 0 then
p := p * A [i];
end;
WriteLn ('Произведение четных элементов = ', p);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var
A: array [1..5] of Integer;
i, p: Integer;
begin
WriteLn ('Массив:');
p := 1;
Randomize;
for i := 1 to 5 do begin
A [i] := Random (10);
WriteLn (i, ': ', A [i]);
if i mod 2 = 0 then
p := p * A [i];
end;
WriteLn ('Произведение четных элементов = ', p);
end.