VBS加减乘除计算的脚本问题

原问题:VBS加减乘除计算的脚本问题
分类:编程开发 > 最后更新时间:【2017-02-25 23:04:26】
问题补充:

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  提供
公告: 为响应国家净网行动,部分内容已经删除,感谢网友理解。
11

分享到:

其他回答

暂无其它回答!

    推荐