输入N(1 <= N <= 10000)
输出N的阶乘
5
120
参考博客:blog.csdn.net/qq_33850438/article/details/50631619
大数乘法问题~
大神代码:
#include<stdio.h> int a[9999]={1,0},n,i,c,len,j; int main() { scanf("%d", &n); for ( len=1,j=2;j<=n; ++j) { for (c=0,i=0; i<len;++i) { a[i]= ( c+= a[i]*j ) % 100000; c/=100000; } if((a[i]=c)>0)++len; } printf("%d",a[--len]); for(;len;) printf("%05d", a[--len]); return 0; }
原文:http://www.cnblogs.com/OMG-By/p/5330552.html