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

while语句
2024年11月30日 11:52
有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