Pagini recente » Cod sursa (job #807589) | Cod sursa (job #953565) | Cod sursa (job #969997) | Cod sursa (job #907583) | Cod sursa (job #286544)
Cod sursa(job #286544)
var f:text;
p,i,n,aux,put:longint;
begin
assign(f,'fact.in');
reset(f);
read(f,p);
close(f);
assign(f,'fact.out');
rewrite(f);
if p=0 then begin write(f,1);
close(f);
halt;
end
else
if p=1 then begin write(f,5);
close(f);
halt;
end
else
begin i:=1;{nr de 0}
n:=5;
while i<p do
begin n:=n+5;
aux:=n; put:=0;
while aux mod 5=0 do
begin inc(put);
aux:=aux div 5;
end;
if put>0 then i:=i+put;
end;
end;
write(f,n);
close(f);
end.