Private Sub Command1_Click() Dim n As Integer, s As Double, a As Long, b As Long, c As Long n = Val(InputBox("请输入n的值!")) a = 2 b = 1 For i = 1 To n s = s + a / b c = a + b b = a a = c Next i MsgBox "所求的和为:" & sEnd Sub