From 0ee6bb7f7c889fad2f09ff9db37a82909bffaf16 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Sat, 28 Sep 2024 15:35:02 -0300 Subject: [PATCH] Solve Positive Numbers in clojure --- solutions/beecrowd/1060/1060.clj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 solutions/beecrowd/1060/1060.clj diff --git a/solutions/beecrowd/1060/1060.clj b/solutions/beecrowd/1060/1060.clj new file mode 100644 index 00000000..798b1fac --- /dev/null +++ b/solutions/beecrowd/1060/1060.clj @@ -0,0 +1,14 @@ +(ns main) + +(defn main [] + (loop [count 0 + line (read-line)] + (if (not line) + count + (recur + (if (> (Double/parseDouble line) 0) + (+ count 1) + count) + (read-line))))) + +(println (format "%d valores positivos" (main)))