VB程序编写求满足条件1+2+3+…+N>1000的最小N

问题描述:

VB程序编写求满足条件1+2+3+…+N>1000的最小N

Private Sub Command1_Click()
Dim n As Integer,s As Integer
n = 1
s = 0
While s s = s + n
n = n + 1
Wend
MsgBox "最小n是:" & n - 1
End Sub