Skip to content

Commit

Permalink
Solve What is the Fastest? in clojure
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Dec 14, 2024
1 parent 7bb81d1 commit f9b8909
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions solutions/beecrowd/2175/2175.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(ns main
(:require [clojure.string :as str]))

(defn main []
(loop [line (read-line)]
(when line
(let [[otavio bruno ian] (map #(Double/parseDouble %) (str/split line #" "))
fastest (min otavio bruno ian)]
(cond
(and (= otavio fastest) (every? #(not= fastest %) [bruno ian]))
(println "Otavio")
(and (= bruno fastest) (every? #(not= fastest %) [otavio ian]))
(println "Bruno")
(and (= ian fastest) (every? #(not= fastest %) [otavio bruno]))
(println "Ian")
:else
(println "Empate")))
(recur (read-line)))))

(main)

0 comments on commit f9b8909

Please sign in to comment.