VBS加减乘除计算的脚本问题
问题补充:
dim a,b,c,d,e,frandomizea = round(rnd * 200 + 1)b = round(rnd * 200 + 1)c = round(rnd * 4 + 1)if c=1 thenf="+"e=a+bend ifif c=2 thenf="-"e=a-bend ifif c=3 thenf="*"e=a*bend ifif c=4 thenf="/"e=a/bend ifd=inputbox (a&f&b&"=?")if e=d thenmsgbox "对了!"elsemsgbox "错了!"end if
----------------------------------------
哪里错了?为什么对和错都显示错?
最佳答案
你的类型不对
if e=d then 前面是数值型,后者是字串
改
if e=cint(d) then
就可以了
最佳答案由网友 whoami1978 提供
其他回答
暂无其它回答!