- #include <stdio.h>
- #include <conio.h>
- #define STRMAX 2000
- #define P 100000
- #define N 3000
- int main()
- {
- long t[STRMAX]={0},a,b,c,g=0,x,e,p=P;
- t[STRMAX-1]=1;
- for (e=1;e <=N;e++)
- for(x=STRMAX-1;x>=0;c=t[x],c*=e,a=c/p,b=c%p,t[x]=b+g,g=a,x--);
- while(t[++x]==0);
- printf( "%ld ",t[x]);
- while(++x <STRMAX)
- printf( "%.5ld ",t[x]);
- getch();return 0;
- }
三千大数阶乘
最新推荐文章于 2021-05-19 10:05:40 发布