#include <stdio.h>
void main()
{
int a[3000]={1};
int n;
printf(" please input n (1~1000):");
do
{
scanf("%d",&n);
}
while (n>1000||n<0);
int wei=0;
for (int i=2;i<=n;i++)
{
int jinwei=0;
for (int j=0;j<=wei;j++)
{
int w=a[j]*i+jinwei;
a[j]=w%10;
jinwei=w/10;
}
while(jinwei)
{
wei++;
a[wei]=jinwei%10;
jinwei/=10;
}
}
int sum=0;
for (int k=wei;k>=0;k--)
{
printf("%d",a[k]);
if(a[k]==0)sum=sum+1;
}
printf("\n");
printf("%d%s%d\n",n,"!中共有0的个数为:",sum);
}
void main()
{
int a[3000]={1};
int n;
printf(" please input n (1~1000):");
do
{
scanf("%d",&n);
}
while (n>1000||n<0);
int wei=0;
for (int i=2;i<=n;i++)
{
int jinwei=0;
for (int j=0;j<=wei;j++)
{
int w=a[j]*i+jinwei;
a[j]=w%10;
jinwei=w/10;
}
while(jinwei)
{
wei++;
a[wei]=jinwei%10;
jinwei/=10;
}
}
int sum=0;
for (int k=wei;k>=0;k--)
{
printf("%d",a[k]);
if(a[k]==0)sum=sum+1;
}
printf("\n");
printf("%d%s%d\n",n,"!中共有0的个数为:",sum);
}