#include <stdio.h>
void cal_fal(int result[],int n,int num)
{
int i=1,j,k;
while(i<=num)
{
if(i==1)
result[0]=1;
for(k=0;k<n;k++)
result[k]*=i;
i++;
for(j=0;j<n;j++)
if(result[j]>=10)
{
result[j+1]+=result[j]/10;
result[j]%=10;
}
}
}
main()
{
int result[500]={0};
int i,k;
int num;
printf("Please input a number:");
scanf("%d",&num);
cal_fal(result,500,num);
i=499;
while(result[i]==0)
i--;
for(k=i;k>=0;k--)
printf("%d",result[k]);
getch();
}