Problem 16 (Project Euler) [和訳])
215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 21000?
Rubyでは一行で書けてしまって、ちっともおもしろくありません。
しかたなく、"LONG_MAX"が2147483647L(< 232)と楽しそうなCで書いてみました。数を文字列として保持しつつし、桁の繰上げを自力で処理するコードがとても汚らしくて、ドロンコ遊びのようでした。