diff --git a/solutions/beecrowd/1035/1035.clj b/solutions/beecrowd/1035/1035.clj new file mode 100644 index 00000000..6fe157f8 --- /dev/null +++ b/solutions/beecrowd/1035/1035.clj @@ -0,0 +1,22 @@ +(ns main + (:require [clojure.string :as str])) + +(defn accepted-values? [a b c d] + (and (> b c) + (> d a) + (> (+ c d) (+ a b)) + (> c 0) + (> d 0) + (zero? (mod a 2)))) + +(defn main [] + (loop [line (read-line)] + (when line + (let [[a b c d] (->> (str/split line #" ") + (map #(Integer/parseInt %)))] + (if (accepted-values? a b c d) + (printf "Valores aceitos%n") + (printf "Valores nao aceitos%n")) + (recur (read-line)))))) + +(main)