Problem 13 (Project Euler) [和訳])
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.(以下略)
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
(以下略)
Rubyだとこの問題をそのまま扱えてしまいます。
そうでなければ、50桁の数字を分割して、右から順次繰り上がりを自前で計算することになります。もっとも、この問題の場合、単純な総和なのであまり難しいことにはなりません。
▲このページのトップへ