Private Sub Form_Click()
i = InputBox("请输入第一个整数")
b = InputBox("请输入第二个整数")
If i Mod 2 = 0 And b Mod 2 = 0 Then
MsgBox i & " " & b & vbCrLf & " 都是偶数"
ElseIf i Mod 2 <> 0 And b Mod 2 <> 0 Then
MsgBox i & " " & b & vbCrLf & " 都是奇数"
Else
MsgBox i & " " & b & vbCrLf & "一个是偶数一个是奇数"
End If
End Sub
看看是不是你要的答案
Private Sub Form_Click()
i = InputBox("请输入第一个整数")
b = InputBox("请输入第二个整数")
If i Mod 2 = 0 And b Mod 2 = 0 Then
MsgBox i & " " & b & vbCrLf & " 都是偶数"
ElseIf i Mod 2 <> 0 And b Mod 2 <> 0 Then
MsgBox i & " " & b & vbCrLf & " 都是奇数"
Else
MsgBox i & " " & b & vbCrLf & "一个是偶数一个是奇数"
End If
End Sub