Dim i As Integer
Dim s As Integer
i = 1
Do
s = s + i * i
i = i + 1
Loop Until s > 1000
MsgBox i - 1
答案是14 望采纳
sum=0
i=0
while sum <1000
i=i+1
sum=sum+i*i
wend
msgbox "最大N值为 " & i-1
sum=0
i=0
while sum <1000
i=i+1
sum=sum+i*i
wend
msgbox "最大N值为 " & i
Private Sub Form_Click()
s = 0
i = 1
Do While s < 1000
s = i * 2 + s
i = i + 1
Loop
Print i - 2
End Sub