VB编程(比较简单的)

VB编程求两个正整数的最大公约数.
2024-11-16 09:29:24
推荐回答(1个)
回答1:

Dim m As Integer
Dim n As Integer
Dim R As Integer
m = Val(Text1.Text)
n = Val(Text2.Text)
R = m Mod n
Do While R <> 0
m = n
n = R
R = m Mod n
Loop
Text3.Text = n