Dim n1, n3, ans As Integer
Dim n2 As String
Public Sub aaa()
n1 = InputBox("Enter num1", "num1")
n2 = InputBox("Enter +-*/", "num2")
n3 = InputBox("Enter num3", "num3")
Call cshun(n1, n2, n3)
Call result
End Sub
Private Sub cshun(n1, n2, n3)
If n2 = "-" Then
ans = n1 - n3
ElseIf n2 = "/" Then
ans = n1 / n3
ElseIf n2 = "*" Then
ans = n1 * n3
Else
ans = n1 + n3
End If
End Sub
Private Sub result()
MsgBox ("the answer is " & Str(ans))
End Sub
3/3=1,3-3=0,3*3=9冇問題,但3+3=33有問題啦 who help me