Factorial1000 by clock

object s,r
s={1}for n=1to 1000do
r=0for k=length(s)to 1by -1do
r+=s[k]*n
s[k]=remainder(r,10)r=floor(r/10)end for
s=sprintf("%d",r)-48&s
end for
puts(1,s+48)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page