VB的问题,在线等答案,急!
PrivateSubForm_Click()Dima%,b%,num1%,num2%,tempnum1=InputBox("请输入一个正整数")num2=InputBox...
Private Sub Form_Click()
Dim a%, b%, num1%, num2%, temp
num1 = InputBox("请输入一个正整数")
num2 = InputBox("请输入一个正整数")
If 【?】 Then
temp = num1: num1 = num2: num2 = temp
End If
a = num1
b = num2
While 【?】
temp = a Mod b
a = b
【?】
Wend
Print "最大公因数为:"; a
Print "最小公倍数为:"; num1 * num2 / a
End Sub
吧问号改成代码,谢谢,好的答案我会加分的! 展开
Dim a%, b%, num1%, num2%, temp
num1 = InputBox("请输入一个正整数")
num2 = InputBox("请输入一个正整数")
If 【?】 Then
temp = num1: num1 = num2: num2 = temp
End If
a = num1
b = num2
While 【?】
temp = a Mod b
a = b
【?】
Wend
Print "最大公因数为:"; a
Print "最小公倍数为:"; num1 * num2 / a
End Sub
吧问号改成代码,谢谢,好的答案我会加分的! 展开
1个回答
展开全部
Private Sub Form_Click()
Dim a%, b%, num1%, num2%, temp
num1 = InputBox("请输入一个正整数")
num2 = InputBox("请输入一个正整数")
If num1 < num2 Then '填空1
temp = num1: num1 = num2: num2 = temp
End If
a = num1
b = num2
While temp <> 0 '填空2
temp = a Mod b
a = b
b = temp '填空3
Wend
Print "最大公因数为:"; a
Print "最小公倍数为:"; num1 * num2 / a
End Sub
Dim a%, b%, num1%, num2%, temp
num1 = InputBox("请输入一个正整数")
num2 = InputBox("请输入一个正整数")
If num1 < num2 Then '填空1
temp = num1: num1 = num2: num2 = temp
End If
a = num1
b = num2
While temp <> 0 '填空2
temp = a Mod b
a = b
b = temp '填空3
Wend
Print "最大公因数为:"; a
Print "最小公倍数为:"; num1 * num2 / a
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询