简易计算器的vbs脚本(1)
a=inputbox("乘法按1,加法按2,除法按3,减法按4","计算器")
if a="1" then
b=inputbox("请输入第一个数字","乘法")
c=inputbox("请输入第二个数字","乘法")
d=b*c
msgbox(d)
end if
if a="2" then
e=inputbox("请输入第一个数字","加法")
f=inputbox("请输入第二个数字","加法")
g=int(e)+int(f)
msgbox(g)
end if
if a="3" then
l=inputbox("请输入第一个数字","除法")
m=inputbox("请输入第二个数字","除法")
n=l\m
msgbox(n)
end if
if a="4" then
h=inputbox("请输入第一个数字","减法")
i=inputbox("请输入第二个数字","减法")
j=h-i
msgbox(j)
end if
举例脚本(可直接复制至你的vbs文件)
a=inputbox("乘法按1,加法按2,除法按3,减法按4","计算器")
if a="1" then
b=inputbox("请输入第一个数字","乘法模式")
c=inputbox("请输入第二个数字","乘法模式")
d=b*c
msgbox(d)
end if
if a="2" then
e=inputbox("请输入第一个数字","加法模式")
f=inputbox("请输入第二个数字","加法模式")
g=int(e)+int(f)
msgbox(g)
end if
if a="3" then
l=inputbox("请输入第一个数字","除法模式")
m=inputbox("请输入第二个数字","除法模式")
n=l\m
msgbox(n)
end if
if a="4" then
h=inputbox("请输入第一个数字","减法模式")
i=inputbox("请输入第二个数字","减法模式")
j=h-i
msgbox(j)
end if