Pagini recente » Cod sursa (job #2471547) | Cod sursa (job #2277475) | Cod sursa (job #1666074) | Cod sursa (job #1779919) | Cod sursa (job #1631520)
var y,x,i,p:int64;
function nz(x:int64):int64;
var q:int64;
begin
q:=0;
while (x <> 0) do
if x mod 10 = 0 then q:=q+1 else break;
nz:=q;
end;
procedure lire;
begin
assign(input,'fact.in');
reset(input);
read(p);
close(input);
end;
procedure ecrire(x:int64);
begin
assign(output,'fact.out');
rewrite(output);
write(x);
close(output);
end;
begin
lire;
x:=1;
y:=trunc(exp(ln(10)*p));
for i:=1 to 9223372036854775807 do
begin
x:=x*i;
if nz(x)=p then begin ecrire(x); break; end;
if x>y then x:=x mod y;
end;
end.