Factorial by yowa

s=999,n,i,x[999];main(){for(;~scanf("%d",x);puts("1"+!!n)){for(i=s;i;x[i--]=0);n=x[0];for(;n&&--n;){for(i=0;i<s;x[i++]*=n);for(i=0;i<s;x[i++]%=10)x[i+1]+=x[i]/10;}for(i=s;~i;printf((n|=x[i--])?"%d":"",x[i]));}}

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

download

return to the top page