diff options
Diffstat (limited to 'src/common.cpp')
-rw-r--r-- | src/common.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common.cpp b/src/common.cpp index 1e7984d..956456f 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -51,3 +51,10 @@ bool is_repeated(const char* p1, const char* p2) { } return true; } + +int gcd(int a, int b) +{ + if (a == 0) + return b; + return gcd(b % a, a); +} |