标签:
‘根据两个数进行加法和减法运算
‘1、输入+号,则进行加法运算
‘2、输入-号,则进行减法运算
Dim opera,operb,result,oper
MsgBox "+.加法功能"&vbcrlf&"-.减法功能"
oper=InputBox("请选择功能")
opera=InputBox("输入a数据")
operb=InputBox("输入b数据")
Select Case oper
Case "+" MsgBox addtest(opera,operb)
Case "-" minus opera,operb
Case Else MsgBox "输入错误"
End Select
Function addtest(opera,operb)
addtest=cint(opera)+cint(operb)
End Function
Sub minus(opera,operb)
result=cint(opera)-cint(operb)
MsgBox result
End sub
标签:
原文地址:http://www.cnblogs.com/aliceluo/p/5586975.html