大神看看哪个地方出错了,求阶乘的和,结果不对?

2025-03-28 05:34:14
推荐回答(1个)
回答1:

将f2的定义改成:
int f2(int i)
{
int n,sum=0;

for(n=1;n<=i;n++)
sum+=f1(n);
return sum;
}