c语言编写一个求和函数s=(1+2)+(2+3+4)+(3+4+5+6).。。。。
编写一个求和函数int sum(int start,int count)返回从start开始前count个数的和值【比如:sum(2 4)返回2+3+4+5的和值】。编写main函数通过调用sum函数求s=(1+2)+(2+3+4)+(3+4+5+6).。。。。前n项的和值,n从键盘输入
结果校验:
n=3
s=(1+2)+(2+3+4)+(3+4+5+6)=30
热门标签:
编写一个求和函数int sum(int start,int count)返回从start开始前count个数的和值【比如:sum(2 4)返回2+3+4+5的和值】。编写main函数通过调用sum函数求s=(1+2)+(2+3+4)+(3+4+5+6).。。。。前n项的和值,n从键盘输入
结果校验:
n=3
s=(1+2)+(2+3+4)+(3+4+5+6)=30