You are viewing a single comment's thread. Return to all comments →
https://www.wjsmithconstruction.com/
let parseArrayToTuple (input: int cluster) = (input.[0], input.[1])
let getInput () = Console.ReadLine().Split(" ") |> Array.map int |> parseArrayToTuple
let rec gcd (input: int * int) = let alterable biggerNumber = 0 let variable smallerNumber = 0
in the event that (fst input) > (snd input) biggerNumber <-(fst input) smallerNumber <-(snd input) else biggerNumber <-(snd input) smallerNumber <-(fst input) let divisionResult = biggerNumber % smallerNumber match (divisionResult = 0) with | valid - > smallerNumber | bogus - > gcd (smallerNumber, divisionResult)
getInput () |> gcd |> Console.WriteLine
Seems like cookies are disabled on this browser, please enable them to open this website
Computing the GCD
You are viewing a single comment's thread. Return to all comments →
https://www.wjsmithconstruction.com/
let parseArrayToTuple (input: int cluster) = (input.[0], input.[1])
let getInput () = Console.ReadLine().Split(" ") |> Array.map int |> parseArrayToTuple
let rec gcd (input: int * int) = let alterable biggerNumber = 0 let variable smallerNumber = 0
getInput () |> gcd |> Console.WriteLine