Private Sub Command1_Click()
Dim a, b
a = Val(InputBox("请输入第一个数"))
b = Val(InputBox("请输入第二个数"))
If Not a = 0 And Not b = 0 Then
If a < b Then c = a: a = b: b = c
Do
If a Mod b = 0 Then Exit Do
c = b
b = a Mod b
a = c
Loop
Print "所求最大公约数为:" & b
End If
End Su