求帮忙看看这个程序为什么output limit exceeded
求1到20间任意数的阶乘#include<stdio.h>
double func(int n)
{
double sum;
if (n == 1 || n == 0)sum=1.0;
else sum = func(n - 1)*n;
return sum;
}
int main()
{
int n;
double sum;
while (scanf("%d", &n) && n != EOF)
{
printf("%.0lf\n",func(n));
}
return 0;
}