Type annotations

This commit is contained in:
David Doblas Jiménez 2022-10-16 16:03:50 +02:00
parent eaf103a283
commit f3b932a04e

View File

@ -18,8 +18,10 @@ function Problem20()
3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Find the sum of the digits in the number 100! =#
fact = factorial(big(100))
return sum(parse(Int, d) for d in string(fact))
fact::BigInt = factorial(big(100))
return sum(parse(Int8, d) for d::Char = string(fact))
end