この問題をPythonで解いた。
#20 Factorial digit sum - Project Euler
日本語の問題文はこちら
n × (n - 1) × ... × 3 × 2 × 1 を n! と表す. 例えば, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800 となる. この数の各桁の合計は 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27 である. では, 100! の各位の数字の和を求めよ.
import math n = 100 print(sum(map(int, str(math.factorial(n)))))