Refactor output

This commit is contained in:
David Doblas Jiménez 2023-08-28 18:49:58 +02:00
parent 9bd496d356
commit e810cdaf1d

View File

@ -10,7 +10,7 @@ https://projecteuler.net/problem=23
using BenchmarkTools using BenchmarkTools
function Problem23() function Problem023()
#= #=
A perfect number is a number for which the sum of its proper divisors is A perfect number is a number for which the sum of its proper divisors is
exactly equal to the number. For example, the sum of the proper divisors exactly equal to the number. For example, the sum of the proper divisors
@ -31,6 +31,7 @@ function Problem23()
Find the sum of all the positive integers which cannot be written as the Find the sum of all the positive integers which cannot be written as the
sum of two abundant numbers. sum of two abundant numbers.
=# =#
LIMIT = 28123 LIMIT = 28123
divisorsum = zeros(Int32, LIMIT) divisorsum = zeros(Int32, LIMIT)
for i in range(1, LIMIT, step = 1) for i in range(1, LIMIT, step = 1)
@ -56,7 +57,7 @@ function Problem23()
end end
println("Time to evaluate Problem $(lpad(23, 3, "0")):") println("Took:")
@btime Problem23() @btime Problem023()
println("") println("")
println("Result for Problem $(lpad(23, 3, "0")): ", Problem23()) println("Result for Problem $(lpad(23, 3, "0")): ", Problem023())