求一段VBscript程序,

来源:百度知道 编辑:UC知道 时间:2024/06/08 20:13:44
依用户在对话框内输入的身高判断是否要购买全票(身高160cm以上需购买全票,140-159cm买半票,139cm以下儿童票)。
测试通过,直接加分!

'将下面保存为.VBS文件就可以了

x=inputbox("请输入身高?")
if x>=160 then
msgbox "全票"
elseif x>=140 then
msgbox "半票"
else
msgbox "儿童票"
end if

h=inputbox("请输入身高")
select case h
case h>=160
msgbox "全票"
case h>=140
msgbox "半票"
case else
mggbox "儿童票"
end select