编写一个vb程序,输出100~200之间不能被3整除的数…

while语句
2024-11-30 11:52:54
推荐回答(3个)
回答1:

Option ExplicitPrivate Sub Command1_Click()
Dim I As Integer, N As Integer
I = 100
While I <= 200
If I Mod 3 = 0 Then
Print I;
N = N + 1
If N Mod 10 = 0 Then Print '十个数换一行
End If
I = I + 1
WendEnd Sub

回答2:

Private Sub form_Click()
Dim I As Integer, N As Integer
I = 100
Do While I <= 200
If I Mod 3 = 0 Then
Print I;
N = N + 1
If N Mod 10 = 0 Then Print
End If
I = I + 1
Loop
End Sub

回答3:

Private Sub Command1_Click()
a = 100
While a <= 200
If a Mod 3 = 0 Then Print a
a = a + 1
Wend
End Sub