一个按钮..
Private Sub Command1_Click()
Randomize Timer
For i = 1 To 20
s = Int((200 - 100 + 1) * Rnd + 100)
If s Mod 3 = 0 And t < 3 Then
Print s
t = t + 1
End If
Next i
End Sub
(没有vb环境,所以只写了开始和结束语之间的语句)在窗体的单击事件中:
for i=1 to 20
a=int(rnd*(200-100+1)+100)
if a mod 3=0 then
print a
s=s+a
end if
next i
if s>0 then print s
遗憾,现在没有VB环境