一道C语言题, 计算1*2*3+3*4*5+。。。。。+99*100*101
#include<stdio.h>intmain(void){intnumber,i,fac=0,p=0;printf("pleaseinpputn:");scanf("...
#include <stdio.h>
int main(void)
{
int number, i, fac = 0, p = 0;
printf("please inpput n:");
scanf("%d", &number);
for (i = 1 ; i <= number ; i = i + 2)
{
p = i * (i + 1) * (i + 2);
fac = fac + p;
}
printf("sum = %d", fac);
return 0;
}
帮忙该一下源程序 展开
int main(void)
{
int number, i, fac = 0, p = 0;
printf("please inpput n:");
scanf("%d", &number);
for (i = 1 ; i <= number ; i = i + 2)
{
p = i * (i + 1) * (i + 2);
fac = fac + p;
}
printf("sum = %d", fac);
return 0;
}
帮忙该一下源程序 展开
6个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询