Cod sursa(job #235527)

Utilizator ioalexno1Alexandru Bunget ioalexno1 Data 24 decembrie 2008 12:15:01
Problema Factorial Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.5 kb
program alex;
var f,g:text;
    p,h:longint;
begin
assign(f,'fact.in');reset(f);
readln(f,p);
close(f);
assign(g,'fact.out');rewrite(g);
if p=0 then write(g,0)
       else begin
            i:=5;
            j:=1;
            repeat
            h:=i*j;
            while h<>0 do
                  begin
                  h:=h div 5;
                  d:=d+1;
                  end;
             j:=j+1;
             until d>=p;
             write(g,i);
             end;
close(g);
end.