( use 'clojure.string)
(defn f[n](let[s(str n)i(map #(-(int %)48)(str(Math/abs n)))](+(apply +(cons(*(first i)(if(< n 0)-1 1))(rest i)))n(count s))))
(defn g[n](let[s(str(Math/abs n))c(count (str n))d(str(if(< n 0)"0""")(join"+"s))i(map #(-(int %)48)s)j(cons(*(first i)(if(< n 0)-1 1))(rest i))s(apply + j)](str n\+ c"+("d")="(+ s c n))))
(println (f 99))
(println (f -123))
(println (f 0))
(println (f 1))
(println (g 99))
(println (g -123))
(println (g 0))
(println (g 1))
KHVzZSAnY2xvanVyZS5zdHJpbmcpCihkZWZuIGZbbl0obGV0W3Moc3RyIG4paShtYXAgIygtKGludCAlKTQ4KShzdHIoTWF0aC9hYnMgbikpKV0oKyhhcHBseSArKGNvbnMoKihmaXJzdCBpKShpZig8IG4gMCktMSAxKSkocmVzdCBpKSkpbihjb3VudCBzKSkpKQooZGVmbiBnW25dKGxldFtzKHN0cihNYXRoL2FicyBuKSljKGNvdW50IChzdHIgbikpZChzdHIoaWYoPCBuIDApIjAiIiIpKGpvaW4iKyJzKSlpKG1hcCAjKC0oaW50ICUpNDgpcylqKGNvbnMoKihmaXJzdCBpKShpZig8IG4gMCktMSAxKSkocmVzdCBpKSlzKGFwcGx5ICsgaildKHN0ciBuXCsgYyIrKCJkIik9IigrIHMgYyBuKSkpKQoocHJpbnRsbiAoZiA5OSkpCihwcmludGxuIChmIC0xMjMpKQoocHJpbnRsbiAoZiAwKSkKKHByaW50bG4gKGYgMSkpCihwcmludGxuIChnIDk5KSkKKHByaW50bG4gKGcgLTEyMykpCihwcmludGxuIChnIDApKQoocHJpbnRsbiAoZyAxKSk=