dim s as long,n as integer
For n=1 to 30000
if s +n >=30000 Then Exit For
s=s+n
Next
Msgbox "最大数是" & n
n^2+n<60000
求deta算呗
Private Sub Command1_Click()
Do
n = n + 1
s = s + n
Loop until s>=30000
Print n - 1
End Sub
dim i as long,
dim s as long,
dim N as long
do while (i>=1 and i<=N)
s=0
s=s+i
i=i+1
next j
loop
do while (s<30000)
print N
loop