You are viewing a single comment's thread. Return to all comments →
hi, here is my solution
defmodule M do def gcd(num1, num2) do num3 = rem(num2, num1) if num3 == 0 do IO.puts num1 else gcd(num3, num1) end end def main() do {min, max} = IO.read(:stdio, :line) |> String.split |> Enum.map(&String.to_integer(&1)) |> Enum.min_max gcd(min, max) end end M.main
Computing the GCD
You are viewing a single comment's thread. Return to all comments →
hi, here is my solution