Skip to content

Commit

Permalink
Solve Fire Flowers in clojure
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Nov 11, 2024
1 parent 2e799e1 commit 9b9ea15
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions solutions/beecrowd/1039/1039.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(ns main
(:require [clojure.string :as str]))

(defn main []
(loop [line (read-line)]
(when line
(let [[r1 x1 y1 r2 x2 y2] (->> (str/split line #" ")
(map #(Integer/parseInt %)))
distance (Math/sqrt
(+
(Math/pow (- x1 x2) 2)
(Math/pow (- y1 y2) 2)))]
(if (>= r1 (+ distance r2))
(println "RICO")
(println "MORTO")))
(recur (read-line)))))

(main)

0 comments on commit 9b9ea15

Please sign in to comment.