用VB写设计程序代码,求:s=1+(1+2)+(1+2+3)+……+(1+2+3+……+n)的值. 要求用DO循环
问题描述:
用VB写设计程序代码,求:s=1+(1+2)+(1+2+3)+……+(1+2+3+……+n)的值. 要求用DO循环
答
在窗体放一个按钮
Private Sub Command1_Click()
Dim n As Long,i As Long,sum As Double,sum0 As Double
n = Val(InputBox("输入一个正整数"))
Do While i