Private Sub Command1_Click()
Dim n As Long, sum As Double
n = Val(InputBox("n=?"))
For i = 1 To n
sum = sum + (-1) ^ (i - 1) * i ^ 2
Next i
MsgBox "所求的和为:" & sum
End Sub
Private Sub Command1_Click()
Dim n As Single, s As Double
n = Val(InputBox("n=?"))
For i = 1 To n
s = s + (-1) ^ (i - 1) * i ^ 2
Next i
print "和为:" & s
End Sub
看不明白
哇哇