VB题 大佬求助啊
PrivateSubForm_Click()DimmAsInteger,nAsInteger,divAsInteger,multiAsIntegerm=Val(Input...
Private Sub Form_Click()
Dim m As Integer, n As Integer, div As Integer, multi As Integer
m = Val(InputBox("请输入一个数m"))
n = Val(InputBox("请输入一个数n"))
div = m
If n < m Then
div = n
End If
Do While m Mod div <> 0 Or n Mod div <> 0
div = ( ) ‘公倍数递减1
Loop
multi =( ) ‘两个数的乘积除以最大公约数
Print "最大公约数是:"; div
Print "最小公倍数是:"; multi
End Sub 展开
Dim m As Integer, n As Integer, div As Integer, multi As Integer
m = Val(InputBox("请输入一个数m"))
n = Val(InputBox("请输入一个数n"))
div = m
If n < m Then
div = n
End If
Do While m Mod div <> 0 Or n Mod div <> 0
div = ( ) ‘公倍数递减1
Loop
multi =( ) ‘两个数的乘积除以最大公约数
Print "最大公约数是:"; div
Print "最小公倍数是:"; multi
End Sub 展开
1个回答
展开全部
Private Sub Form_Click()
Dim m As Integer, n As Integer, div As Integer, multi As Integer
m = Val(InputBox("请输入一个数m"))
n = Val(InputBox("请输入一个数n"))
div = m
If n < m Then
div = n
End If
Do While m Mod div <> 0 Or n Mod div <> 0
div = div - 1 '公倍数递减1
Loop
multi = m * n / div '两个数的乘积除以最大公约数
Print "最大公约数是:"; div
Print "最小公倍数是:"; multi
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询