解题思路:大数运算使用数组来存取数组,数组范围要足够大
注意事项:
参考代码:
#include<stdio.h>
int main()
{
int n,f,count=1,i,j,k,t;
int a[10000];
a[0] = 1;
scanf("%d",&n);
for(i =1;i<=n;i++){
f=0;
for( j=0;j<count;j++){
t = a[j]*i+f;
f =t /10;
a[j] = t%10;
}
while(f){
a[count] = f%10;
f/=10;
count++;
}
}
for( k = count-1;k>=0;k--){
printf("%d",a[k]);
}
return 0;
}
0.0分
0 人评分