Cod sursa(job #413916)
| Utilizator | Data | 9 martie 2010 13:25:17 | |
|---|---|---|---|
| Problema | Factorial | Scor | 25 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
var p : longint;
n, m : longint;
t : text;
begin
assign(t,'fact.in');
reset(t);
readln(t,p);
if p=0 then n:=1;
while p>0 do begin inc(n,5);
m:=n;
while m mod 5=0 do begin dec(p);
m:=m div 5;
end;
end;
close(t);
assign(t,'fact.out');
rewrite(t);
writeln(t,n);
close(t);
end.
