Var c:array [1..10] of integer; i, even, positive, sumLessSix: integer; begin randomize; writeln ('Рандомный массив'); for i:=1 to 10 do begin c[i]:= random(20)-10; write (c[i],' '); end; {for} writeln; writeln('Произведение четных чисел'); even:=1; for i:=1 to 10 do if c[i] mod 2 = 0 then even:= even*c[i]; write(even,' '); writeln; writeln('Произведение положительных чисел'); positive:=1; for i:=1 to 10 do if c[i] > 0 then positive:= positive*c[i]; write(positive,' '); writeln; writeln('Сумма элементов меньших 6'); positive:=1; for i:=1 to 10 do if c[i] < 6 then sumLessSix:= sumLessSix+c[i]; write(sumLessSix,' '); end.
c:array [1..10] of integer;
i, even, positive, sumLessSix: integer;
begin
randomize;
writeln ('Рандомный массив');
for i:=1 to 10 do begin
c[i]:= random(20)-10;
write (c[i],' ');
end; {for}
writeln;
writeln('Произведение четных чисел');
even:=1;
for i:=1 to 10 do
if c[i] mod 2 = 0 then
even:= even*c[i];
write(even,' ');
writeln;
writeln('Произведение положительных чисел');
positive:=1;
for i:=1 to 10 do
if c[i] > 0 then
positive:= positive*c[i];
write(positive,' ');
writeln;
writeln('Сумма элементов меньших 6');
positive:=1;
for i:=1 to 10 do
if c[i] < 6 then
sumLessSix:= sumLessSix+c[i];
write(sumLessSix,' ');
end.