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