diff --git a/evildoer/gcd.c b/evildoer/gcd.c new file mode 100644 index 0000000..9f81af5 --- /dev/null +++ b/evildoer/gcd.c @@ -0,0 +1,12 @@ +#include + +int64_t gcd(int64_t a, int64_t b) { + int remainder = a % b; + + if (remainder == 0) { + return b; + } + + return gcd(b, remainder); +} +