以下代码为输入任意多个数字 进行统计 如果输入0 则退出循环 显示出统计结果
Private Sub Command1_Click()
Dim i As Integer
Dim q As Integer
Dim o As Integer
q = 0
o = 0
Do
i = InputBox("输入数字")
If i = 0 Then Exit Do
If i Mod 2 = 0 Then
o = o + 1
Else
q = q + 1
End If
Loop
msgbox o & " " & q
End Sub
温馨提示:内容为网友见解,仅供参考