Pagini recente » Cod sursa (job #70186) | Cod sursa (job #908467) | Cod sursa (job #801325) | Cod sursa (job #174105) | Cod sursa (job #247236)
Cod sursa(job #247236)
var i,p,j,jjj:longint; nr5:byte;
f:text;
begin
assign (f,'fact.in');
reset (f);
readln (f,p);
close (f);
if p=0 then
begin
assign (f,'fact.out');
rewrite (f);
writeln (f,1);
close(f);
end
else
begin
i:=5;
while nr5<>p do
begin
nr5:=0;
while j<=i do
begin
jjj:=j;
while (jjj<>0) do
begin
if jjj mod 5=0 then
inc (nr5);
jjj:=jjj div 5;
end;
end;
inc(j,1);
inc (i,5);
end;
if nr5=p then
begin
assign (f,'fact.out');
rewrite (f);
writeln (f,i);
close(f);
end;
end;
end.