var
a:array [0..7] of integer;
i, p:integer;
begin
for i:=0 to 7 do begin
write('['+inttostr(i)+']=');
readln(a[i]);
end;
p:=1;
write('Элементы кратные 3 = ');
for i:=0 to 7 do
if a[i] mod 3 = 0 then begin
write(a[i]+' ');
p := p*a[i];
writeln();
if p<>1 then
write('Произведение элементов кратных 3 =' + p);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
a:array [0..7] of integer;
i, p:integer;
begin
for i:=0 to 7 do begin
write('['+inttostr(i)+']=');
readln(a[i]);
end;
p:=1;
write('Элементы кратные 3 = ');
for i:=0 to 7 do
if a[i] mod 3 = 0 then begin
write(a[i]+' ');
p := p*a[i];
end;
writeln();
if p<>1 then
write('Произведение элементов кратных 3 =' + p);
end.