From f3b932a04e912a0ed1580f5f80e18dab68720a00 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Sun, 16 Oct 2022 16:03:50 +0200 Subject: [PATCH] Type annotations --- src/Julia/Problems001-050/Problem020.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Julia/Problems001-050/Problem020.jl b/src/Julia/Problems001-050/Problem020.jl index 6b02a92..b9ade14 100644 --- a/src/Julia/Problems001-050/Problem020.jl +++ b/src/Julia/Problems001-050/Problem020.jl @@ -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