Cod sursa(job #344665)

Utilizator skullLepadat Mihai-Alexandru skull Data 31 august 2009 11:59:58
Problema Factorial Scor 10
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.29 kb
var n,p,x:longint;
    f,g:text;
begin
assign(f,'fact.in');reset(f);
assign(g,'fact.out');rewrite(g);
readln(f,p);
n:=0;
n:=p * 5;
x:=25;
while n>x do
      begin
      x:=x*5;
      n:=n-5;
      end;
if p<>0 then
   write(g,n)
   else
   write(g,'1');
close(f);
close(g);
end.