Cod sursa(job #642889)
Utilizator | Data | 2 decembrie 2011 15:10:57 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
Program factorial;
var y,x,p,i:longint;
fin,fout:text;
begin
assign(fin,'fact.in');reset(fin);
assign(fout,'fact.out');rewrite(fout);
readln(fin,p);
if (p>=0) and(p<=100000000)then
begin
y:=1;
for i:=1 to p do
y:= y*10;
i:=0;
x:=1;
repeat
i:=i+1;
x:=x*i;
until x mod y=0;
writeln(fout,i);
end;
close(fin);
close(fout);
end.