11智能在线
新记
S=1+(1+2)+(1+2+3)+……+(1+2+3+……+10)vfp编程。
如题所述
举报该文章
相关建议 2017-06-16
先找规律, 有n项(这里n=10)相加, 每个项又是累加, 使用嵌套循环. 参考代码:
clear
s1=0
for i=1 to 10
s2=0
for j=1 to i
s2=s2+j
endfor
s1=s1+s2
endfor
?s1
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/7fsp877pvqpfsp2pmp.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
编写程序求s=1+(1+2)+(1+2+3)+…+(1+2+...
用C语言编写程序,计算s=1+(1+2)+(1+2+3)+…...
用C#程序设计一个控制台应用程序项目输入正整数n,计算s=1...
C++编写程序,计算s=1+(1+2)+(1+2+3)+…+...
用C语言编写程序,求s=1+(1+2)+(1+2+3)+(1...
求C语言编程计算,1+(1+2)+(1+2+3)+(1+2+...
编写一个程序,求s=1+(1+2)+(1+2+3)+……+(...
c语言,用循环语句编写程序,计算S的值,S=1!+2!+3!...