From 7edd7346d044e33cca74b4f891e6a4fd6bf65442 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Sun, 22 Dec 2024 09:38:08 -0300 Subject: [PATCH] Solve Old Clock in clojujre --- solutions/beecrowd/3084/3084.clj | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 solutions/beecrowd/3084/3084.clj diff --git a/solutions/beecrowd/3084/3084.clj b/solutions/beecrowd/3084/3084.clj new file mode 100644 index 00000000..2f6209f1 --- /dev/null +++ b/solutions/beecrowd/3084/3084.clj @@ -0,0 +1,11 @@ +(ns main + (:require [clojure.string :as str])) + +(defn main [] + (loop [line (read-line)] + (when line + (let [[hour-degree minute-degree] (map #(Integer/parseInt %) (str/split line #" "))] + (printf "%02d:%02d%n" (int (/ hour-degree 30)) (int (/ minute-degree 6)))) + (recur (read-line))))) + +(main)