做一个vbs计算器
工具/原料
1
windows
2
记事本
方法/步骤
1
新建一个文本文档。把后缀名改为vbs或者vbe。
2
右击后点编辑。
3
输入如下内容:_______________________________分割线________________________________________a = Inputbox('请输入数值1')b = InputBox('请输入运算符号')c = InputBox('请输入数值2')sub err a = Inputbox('请输入数值1') b = InputBox('请输入运算符号') c = InputBox('请输入数值2')end subif not(b='+' or b='-' or b='*' or b='/') or not(isnumeric(a) or not(isnumeric(b))) or not(b=('+') or b=(')-') or b=('*') or b=('/'))Thenmsgbox '运算符号或/和数值不对,请重试。' call errElseIf b = '+' Then msgbox Int(a) + Int(c)Else If b = '-' Then msgbox a - c Else If b = '*' Then msgbox a * c Else If b = '/' Then msgbox a / c Else End If End If End If End IfEnd If
4
保存
上一篇:如何用XP的计算器计算阶乘
下一篇:教你用多功能计算器