View Code 

#include<stdio.h>
#include<string.h>
#define N 16325
int a[N];
main()
{
    int i,j,m;
    scanf("%d",&m);
    memset(a,0,sizeof(a));
    a[0]=1;
    for(i=2;i<=m;i++)
    {
        int c=0;
        for(j=0;j<N;j++)
        {
            int s=a[j]*i+c;
            a[j]=s%10;
            c=s/10;//进位
        }
    }
    for(j=N-1;j>=0;j--)//结果是倒序存放的
    {
        if(a[j])
        break;//并未继续执行j--
    }
    for(i=j;i>=0;i--)//退出时j嗨未自减
    {
        printf("%d",a[i]);
    }
    printf("\n");
    return 0;
}

  

 

相关文章:

  • 2021-08-18
猜你喜欢
  • 2022-01-31
  • 2022-02-27
  • 2022-12-23
  • 2021-12-03
  • 2021-12-28
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案