dim i as integer, j as integer, k as integer, r as integer
k = 1r = 0for 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 + 1next i
k 就是最后的结果
谢谢楼上的哈哈,不是楼主!