const n=6; var i,k:byte; p:longint; a:array[1..n] of shortint; begin Randomize; k:=0; p:=1; ClrScr; for i:=1 to n do begin a[i]:=Random(51)-25; { [-25..25] } Write(a[i],' '); if a[i] mod 5=0 then begin k:=k+1; p:=p*a[i] end end; Writeln; Writeln('k=',k,', P=',p); ReadKey end.
const
n=6;
var
i,k:byte;
p:longint;
a:array[1..n] of shortint;
begin
Randomize;
k:=0; p:=1;
ClrScr;
for i:=1 to n do begin
a[i]:=Random(51)-25; { [-25..25] }
Write(a[i],' ');
if a[i] mod 5=0 then begin k:=k+1; p:=p*a[i] end
end;
Writeln; Writeln('k=',k,', P=',p);
ReadKey
end.