如何让递归多次大循环 就比如求1!+2!+3!+4!+5! 求完5!后让n-1 再求4的阶乘
#include<stdio.h>
int f(int n)
{
int result=0;
if(n==0 || n==1)
{
result = 1;
}
else
{
result= f(n-1)*n;
}
return result;
}
int main()
{
int n;
scanf("%d",&n);
printf( "%d\n", f(n));
return 0;
}