填空题
请补充main()函数,该函数的功能是求出1!+2!+3!+4!…+N!的和。
例如,1!+2!+3!+4!+…+9!=409113。
注意:部分源程序给出如下。
仅在横线上填写所需要的若干表达式或语句,请勿改动函数中的其他任何内容。
试题程序:
#include<stdio.h>
void main()
{
int i, n;
long sum=0, temp=1;
printf("/nInput n: /n");
scanf("%d",
1);
for(i=1; i<=n; i++)
{
temp=
2;
sum=
3;
}
printf("1!+…+%d!=%1d/n", n, sum);
}