Dim n As Integer, i As Integer, j As IntegerDim s As Longn = Val(InputBox("请输入n"))For i = 1 To n For j = 1 To i s = s + j Next jNext iMsgBox "结果为" & s