3个回答
2014-05-20
展开全部
看看这个行吗?Private Sub Command1_Click()
Dim s, n As Double
n = InputBox("请你输入数值:", "提示")
For n = 1 To n
s = s + 1 / (n * (n + 1))
Next n
MsgBox s
End Sub
Dim s, n As Double
n = InputBox("请你输入数值:", "提示")
For n = 1 To n
s = s + 1 / (n * (n + 1))
Next n
MsgBox s
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-05-20
展开全部
Option ExplicitPrivate Sub Command1_Click()
Dim sum As Double, i As Integer
For i = 1 To Val(Text1)
sum = sum + 1 / i / (i + 1)
Next
Label1.Caption = sum
End SubPrivate Sub Form_Load()
Label1.Caption = "": Text1 = 10: Command1.Caption = "计算"
End Sub
Dim sum As Double, i As Integer
For i = 1 To Val(Text1)
sum = sum + 1 / i / (i + 1)
Next
Label1.Caption = sum
End SubPrivate Sub Form_Load()
Label1.Caption = "": Text1 = 10: Command1.Caption = "计算"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-05-20
展开全部
Private Sub Command1_Click()
Dim n As Double
Dim i As Integer
n = 0
For i = 1 To Int(Val(Text1.Text))
n = n + 1 / (i * (i + 1))
Next i
Label1.Caption = n
End Sub
Dim n As Double
Dim i As Integer
n = 0
For i = 1 To Int(Val(Text1.Text))
n = n + 1 / (i * (i + 1))
Next i
Label1.Caption = n
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询