以下是引用Kendy123456在2007-5-15 9:52:13的发言:
dim i as integer, j as integer, k as integer, r as integer
k = 1
r = 0
for i = 1 to 1000
for j = 1 to k
r = r + 1
if r = 1004 then
exit for
end if
next j
if r = 1004 then
exit for
end if
k = k + 1
next i
k 就是最后的结果
谢谢楼上的哈哈,不是楼主!