vb编写程序使用递归求最大公约数
答案:1 悬赏:80
解决时间 2021-03-03 08:13
- 提问者网友:斑駁影
- 2021-03-03 02:19
vb编写程序使用递归求最大公约数
最佳答案
- 二级知识专家网友:旧脸谱
- 2021-03-03 02:43
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = Text1
b = Text2
Text3 = gcd(a, b)
End Sub
Function gcd(ByVal a As Integer, ByVal b As Integer) As Integer
If a Mod b = 0 Then gcd = b Else gcd = gcd(b, a Mod b)
End Function
Dim a As Integer, b As Integer
a = Text1
b = Text2
Text3 = gcd(a, b)
End Sub
Function gcd(ByVal a As Integer, ByVal b As Integer) As Integer
If a Mod b = 0 Then gcd = b Else gcd = gcd(b, a Mod b)
End Function
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |