#include <stdio.h>
double SumFac(int a);
int main()
{
int n, r;
scanf("%d", &n);
r = SumFac(n);
printf("%d", r);
return 0;
}
double Fac(int a)
{
double x;
if (a == 1||a == 0)
{
x = 1;
}
else
{
x = Fac(a - 1) * a;
}
return x;
}
double SumFac(int a)
{
double x;
if (a>0)
{
x = SumFac(a - 1)+Fac(a);
}
return x;
}
用递归求阶乘和 (1!+2!+3!+....+n!)