НОК НОД GCF LCM

PHOTO EMBED

Wed Aug 24 2022 20:09:51 GMT+0000 (UTC)

Saved by @Elastep #c#

    static int gcf(int a, int b)
    {
        while (b != 0)
        {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    static int lcm(int a, int b)
    {
        return (a / gcf(a, b)) * b;
    }
content_copyCOPY