Private Sub Form_Click()
Dim i As Integer, y As Single, n As Integer, s As Single
n = InputBox("输入n值", "")
For i = 1 To n
y = (-1) ^ (i - 1)
s = s + y / n
Next i
Print s
与
Private Sub Form_Click()
Dim i As Integer, y As Single, n As Integer, s As Single
n = InputBox("输入n值", "")
s = 1
For i = 2 To n
y = (-1) ^ (i - 1)
s = s + y / n
Next i
Print s
这两个结果为什么会不同呢?请教