Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (11 sloc) 486 Bytes
#!/usr/bin/env clj
; Uni code to rule them all
(import '(java.io InputStreamReader BufferedReader))
(def input (BufferedReader. (InputStreamReader. System/in "UTF-16LE")))
(defn readline [] (.readLine input))
(def valid-number #"\p{Zs}*(\p{Nd}+)\p{Zs}*")
(.read input) ; skip BOM
(dotimes [n (read-string (readline))]
(if-let [[_ t] (re-matches valid-number (readline))]
(printf "Case #%d: %s\n" (inc n) (.toString (biginteger t) 16))
(printf "Case #%d: N/A\n" (inc n))))