我是编程的新手,并且遇到了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 ×1