2 lines
104 B
Scala
2 lines
104 B
Scala
def gcd(a: Int, b: Int):Int=if (b==0) a.abs else gcd(b, a%b)
|
|
def lcm(a: Int, b: Int)=(a*b).abs/gcd(a,b)
|