You are viewing a single comment's thread. Return to all comments →
Clojure solution
(require '[clojure.string :as str]) (defn cmmdc [x y] (if (= x y) x (if (> x y) (recur (- x y) y) (recur x (- y x))))) (let [line (map read-string (str/split (read-line) #" "))] (println (cmmdc (first line) (first (rest line)))))
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 →
Clojure solution