int func(void)
{
long result = 1;
unsigned int i = 1000;
for (i=1000; i>0; i--)
{
result = result * i;
}
return result;
}
#include
int main()
{
int res[10000];
res[0] = 1;
int n = 0;
printf("Please Input n:");
scanf("%d", &n);
int len = 1;
for (unsigned int i = 2; i <= n; i ++)
{
unsigned int jinwei = 0 ;
for (unsigned int j = 0; j < len; j ++)
{
unsigned int tmp = res[j] * i + jinwei;
res[j] = tmp % 10;
jinwei = tmp / 10;
}
while (jinwei > 0)
{
res[len++] = jinwei % 10;
jinwei = jinwei / 10;
}
}
for(int i = len-1; i >=0; i --)
{
printf("%d", res[i]);
}
}