c语言求s=1!+2!+3!+…+n!(n由输入决定).尤其是for语句里面是什么意思#includevoid main(){int i,j,n;long int t=1,sum=0;printf("input n:",&n);scanf("%d",&n);for (i=1;i
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/27 12:56:56
c语言求s=1!+2!+3!+…+n!(n由输入决定).尤其是for语句里面是什么意思#includevoid main(){int i,j,n;long int t=1,sum=0;printf("input n:",&n);scanf("%d",&n);for (i=1;i
c语言求s=1!+2!+3!+…+n!(n由输入决定).尤其是for语句里面是什么意思
#include
void main()
{
int i,j,n;
long int t=1,sum=0;
printf("input n:",&n);
scanf("%d",&n);
for (i=1;i
c语言求s=1!+2!+3!+…+n!(n由输入决定).尤其是for语句里面是什么意思#includevoid main(){int i,j,n;long int t=1,sum=0;printf("input n:",&n);scanf("%d",&n);for (i=1;i
您好!很高兴为您解答.
解释如下:
#include
void main()
{
int i,j,n;
long int t=1,sum=0;//必要的初始化,保证后面for循环的语句“sum=sum+t;”能正常执行.
printf("input n:",&n);
scanf("%d",&n);//输入式中n
for (i=1;i