n! means n Ã (n − 1) Ã ... Ã 3 Ã 2 Ã 1
Find the sum of the digits in the number 100!
Molto rudimentale il mio modo di risolverlo.Si poteva fare con un bel ciclo for,ma non avevo voglia
Python
Codice:
asd=100
n=asd-1
i=0
number=0
while(n>1):
asd=asd*n
n=n-1
test=str(asd)
gay=int(test[i])
while(i<len(test)):
gay=int(test[i])
number= number+gay
i=i+1
print "sum = ", + number