Pagini recente » Cod sursa (job #1912671) | Cod sursa (job #764357) | Cod sursa (job #380817) | Cod sursa (job #395466) | Cod sursa (job #2045215)
Program fact;
var f, g:text;
i, j, n:byte;
p:longint;
m:extended;
begin
assign(f, 'fact.in');
assign(g, 'fact.out');
reset(f); rewrite(g);
readln(f, n);
if n=0 then begin writeln(1);
halt;
end;
p:=1; m:=1;
For i:=1 to n do p:=p*10;
For i:=5 to 170 do begin For j:=1 to i do m:=m*j;
if frac(m/p)=0 then begin writeln(g, i);
break;
end;
m:=1;
end;
close(f); close(g);
end.