小编Tom*_*ggs的帖子

当值超过100,000+时,Cint溢出错误

我是编程的新手,并且遇到了Cint溢出错误的麻烦.每当值达到100,000+时,我都会收到Cint溢出错误.这是我编程课程的一个练习练习.据我所知,我在实践中完全按照它编写的方式对其进行了编码,但实践表明使用的值高达300,000.有人可能会解释我可能做错了什么吗?

<script language="VBscript">
Option Explicit
DIM numberofshifts, totalshift1, totalshift2, _
  totalshift3, grandtotal, shiftaverage
numberofshifts=3
totalshift1 = Inputbox("How many widgets during the first shift")
totalshift2 = Inputbox("How many widgets during the second shift")
totalshift3 = Inputbox("How many widgets during the third shift")
grandtotal = cint(totalshift1) + totalshift2 + totalshift3
shiftaverage = grandtotal / numberofshifts
Document.write "The Total of the Three Shifts is " & grandtotal
Document.write "<br>The Average of the Three Shifts is " & shiftaverage
</script>
Run Code Online (Sandbox Code Playgroud)

vbscript

19
推荐指数
1
解决办法
4万
查看次数

标签 统计

vbscript ×1