Created
September 4, 2020 16:43
-
-
Save VxDxK/868035fd1659193ee8a7a9f3aa93d765 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int gcd (int a, int b) { | |
while (b) { | |
a %= b; | |
swap (a, b); | |
} | |
return a; | |
} | |
int lcm (int a, int b) { | |
return a / gcd (a, b) * b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment