Cod sursa(job #451077)
Utilizator | Data | 8 mai 2010 22:04:03 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
var t : text;
p, x, y : word;
begin
assign(t,'fact.in');
reset(t);
readln(t,p);
close(t);
if p=0 then x:=1;
while p>0 do begin inc(x,5);
y:=x;
while y mod 5=0 do begin y:=y div 5;
dec(p);
end;
end;
assign(t,'fact.out');
rewrite(t);
writeln(t,x);
close(t);
end.