Pagini recente » Diferente pentru problema/captcha intre reviziile 7 si 33 | Monitorul de evaluare | Diferente pentru problema/sr intre reviziile 2 si 3 | Cod sursa (job #2709030) | Cod sursa (job #6111)
Cod sursa(job #6111)
Program Factorial;
var f,g:text;
nrp,x,y,p:longint;
Begin
assign(f,'fact.in');
reset(f);
read(f,p);
If p<>0 then
begin
x:=5;
nrp:=1;
end
Else
x:=1;
while nrp<p do
begin
x:=x+5;
y:=x;
while (y mod 5=0) do
begin
nrp:=nrp+1;
y:=y div 5;
end;
end;
assign(g,'fact.out');
rewrite(g);
writeln(g,x);
close(g);
close(f);
End.