@media (prefers-color-scheme: ${dark or light}) { // ... }

求最大公因數的三種表示法

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 留言