Program n1;
var a,p,k: integer;
begin
k:=0;
p:=1;
readln(a);
while(a<>0) do begin
if a>0 then begin
k:=k+1;
p:=p*a;
end;
writeln('k>0: ',k);
write('p=',p);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Program n1;
var a,p,k: integer;
begin
k:=0;
p:=1;
readln(a);
while(a<>0) do begin
if a>0 then begin
k:=k+1;
p:=p*a;
end;
readln(a);
end;
writeln('k>0: ',k);
write('p=',p);
end.