标签:des style blog color io os ar java for
1 2 3
1 2 6#include<stdio.h> int main() { int i,j,n,m; while(scanf("%d",&n)!=EOF) { if(n<0) { continue; } int str[10000]={0}; str[0]=1; m=0; for(i=1;i<=n;i++)//m用来控制进位。 for(j=0;j<=m;j++) { str[j]=str[j]*i; if(j>0&&str[j-1]>=10000) { str[j]=str[j]+str[j-1]/10000; str[j-1]=str[j-1]%10000; } if(str[m]>=10000) m++; } printf("%d",str[m]); for(i=m-1;i>=0;i--) printf("%04d",str[i]); printf("\n"); } return 0; }
标签:des style blog color io os ar java for
原文地址:http://blog.csdn.net/hdd871532887/article/details/40456071