vb编程怎么写?

2024-10-31 00:05:21
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Dim x As Integer
ji = 0
ou = 0
For i = 1 To 10
x = InputBox("请输入第" & i & "个整数:")
If x Mod 2 = 1 Then ji = ji + 1 Else ou = ou + 1
Next i
Text1 = "奇数 " & qi & " 个,偶数 " & ou & " 个"
End Sub