2个回答
2020-01-03
展开全部
按照楼主的题目前半部分
1*2*3
3*4*5
5*6*7
7*8*9
9*10*11
11*12*13
.....
根本不可能出现 10*11*12 ??
莫名其妙!!!!!
#include <stdio.h>
int main()
{ int i,t,sum=0;
printf("Beginning... \n");
for(i=0;i<6;i++)
{ t = 2*i+1;
sum += t*(t+1)*(t+2);
printf("%2d * %2d * %2d = %4d\n",t,t+1,t+2,t*(t+1)*(t+2));
}
printf("\nsum=%d\n",sum);
return 0;
}
运行结果
Beginning...
1 * 2 * 3 = 6
3 * 4 * 5 = 60
5 * 6 * 7 = 210
7 * 8 * 9 = 504
9 * 10 * 11 = 990
11 * 12 * 13 = 1716
sum=3486
1*2*3
3*4*5
5*6*7
7*8*9
9*10*11
11*12*13
.....
根本不可能出现 10*11*12 ??
莫名其妙!!!!!
#include <stdio.h>
int main()
{ int i,t,sum=0;
printf("Beginning... \n");
for(i=0;i<6;i++)
{ t = 2*i+1;
sum += t*(t+1)*(t+2);
printf("%2d * %2d * %2d = %4d\n",t,t+1,t+2,t*(t+1)*(t+2));
}
printf("\nsum=%d\n",sum);
return 0;
}
运行结果
Beginning...
1 * 2 * 3 = 6
3 * 4 * 5 = 60
5 * 6 * 7 = 210
7 * 8 * 9 = 504
9 * 10 * 11 = 990
11 * 12 * 13 = 1716
sum=3486
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询