Private Sub Form_Click() |
x = Val(InputBox( "请输入第一个数:" )) |
y = Val(InputBox( "请输入第二个数:" )) |
If x < y Then |
t = x |
x = y |
y = t |
End If |
x 1 = x |
y1 = y |
Print x, y |
Do While y <> 0 |
r = x Mod y |
x = y |
y = r |
Loop |
Print "最大公约数为:" ; x |
Print "最小公倍数为:" ; x1 *y1 / x |
End Sub |