溢出问题
代码如下:
Private Sub Form_Load()
Dim n As Variant
Dim n1 As Variant
Dim n2 As Variant
Dim total As Variant
Dim score As Variant
End Sub
Private Sub Command1_Click()
start:
score = InputBox("请输入分数(-1结束)", "输入分数")
If score < 0 Or score > 100 Then
GoTo finish
Else
total = total + score
n = n + 1
If score < 60 Then
n1 = 1 + 1
Else
n2 = n2 + 1
End If
End If
GoTo start:
finish:
End Sub
Private Sub Command2_Click()
Text1.Text = Str$(n1)
Text2.Text = Str$(n2)
Text3.Text = Str$(total / n) //单击command2的时候此行老是溢出
End Sub
Private Sub Command3_Click()
End
End Sub
大哥大姐能不能告诉我问题出在哪里啊?? 谢谢了啊??