Cod sursa(job #451075)

Utilizator autoplayerBerendea autoplayer Data 8 mai 2010 21:58:20
Problema Factorial Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.4 kb
var t : text;
    p, x, y : longint;
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');
writeln(t,x);
close(t);
end.