You are viewing a single comment's thread. Return to all comments →
Python
def factorial(n): if n == 0 or n == 1: return 1 else: resultado = n * factorial(n - 1) return resultado def run(): n = int(input()) f = factorial(n) fs = str(f) s = 0 for e in fs: s += int(e) print(s) for _ in range(int(input())): run()
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #20: Factorial digit sum
You are viewing a single comment's thread. Return to all comments →
Python