一 | Function GCD(ByVal a%, ByVal b%) Do Until a = b If a > b Then a -= b If a < b Then b -= a Loop GCD = a End Function |
二 | Function GCD(ByVal a%, ByVal b%) GCD = If(b = 0, a, GCD(b, a Mod b)) End Function |
三 | Function GCD(ByVal a%, ByVal b%) If b = 0 Then GCD = a Else GCD = GCD(b, a Mod b) End If End Function |
0 留言