vb溢出问题
我代码这样写的:
Private Sub Command1_Click()
Dim x As Integer, y As Integer, m As Integer, n As Integer, r As Integer
x = InputBox("ÇëÊäÈëÒªÇó×î´ó¹«Ô¼ÊýµÄÕûÊý", " ÇóÁ½ÊýµÄ×î´ó¹«Ô¼Êýstep1", 0)
y = InputBox("ÇëÊäÈëÒªÇó×î´ó¹«Ô¼ÊýµÄÕûÊý", " ÇóÁ½ÊýµÄ×î´ó¹«Ô¼Êýstep2", 0)
Print "ÕûÊý1 : step1>>>"; x, "ÕûÊý2 : step2>>>"; y
If x - y > 0 Then
n = y
Else
n = x
x = y
y = n
r = x - y
End If
Dim i As Integer
i = 1
Do
If n - r > 0 Then
m = n
n = r
Else
m = r
End If
r = m - n
i = i + 1
Loop Until r = 0
Print "step3£ºÖ´Ðв½Êý£º"; i
Print "½á¹û£º ×î´ó¹«Ô¼ÊýΪ ¡·¡·¡·"; n
End Sub
是自己做的用来求最大公约数的
求解,怎么一计算较大数据就提示溢出了?
追问:有用怎么用?