Skip to content

Commit a82424b

Browse files
committed
Fix gcd
1 parent 96aa388 commit a82424b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/number/lcm.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ll gcd(ll a, ll b) {
2-
if (a < b)swap(a, b);
3-
if (b == 0)return a;
4-
return gcd(b, a % b);
2+
if (b == 0) return a;
3+
else return gcd(b, a % b);
54
}
65

76
ll lcm(ll a, ll b) {

0 commit comments

Comments
 (0)