Cod sursa(job #1451975)

Utilizator ianic1999Ianic Umanschii ianic1999 Data 19 iunie 2015 13:09:35
Problema Factorial Scor 15
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.35 kb
var p,n,i,j,k:int64;
begin
 assign(input,'fact.in');
 reset(input);
  read(p);
 close(input);

  k:=1;
  j:=0;
  while j<p do
   begin
     k:=k+1;
      n:=k;
      while n mod 5=0 do
       begin
        j:=j+1;
        n:=n div 5;
       end;
   end;

 assign(output,'fact.out');
 rewrite(output);
  write(k);
 close(output);
end.