Function GCD(m As Long, n As Long) As Long
Dim temp As Long, r As Long
If m < n Then temp = m: m = n: n = temp
d = m - n
Do While d <> n
If d >= n Then
m = d
Else
m = n
n = d
End If
d = m - n
Loop
GCD = n
End Function
Private Sub Command1_Click()
Text1.Text = Str(GCD(48,36))
End Sub
程序运行完后,单击Command1按钮,文本框Text1中显示的是 ( )