Skip to content

Instantly share code, notes, and snippets.

@bakyeono
Created April 16, 2016 06:51
Show Gist options
  • Save bakyeono/601d1cd2948f6e9aa99d20da34575a67 to your computer and use it in GitHub Desktop.
Save bakyeono/601d1cd2948f6e9aa99d20da34575a67 to your computer and use it in GitHub Desktop.
Read from STDIN, write to STDOUT in Clojure
;; read from STDIN
(line-seq (java.io.BufferedReader. *in*))
(map #(Integer/parseInt %) (line-seq (java.io.BufferedReader. *in*)))
;; write elements of a sequence, line by line, to STDOUT
(doseq [elm result] (print (str elm "\n")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment