Skip to content

Commit

Permalink
Fix compilation errors in 5
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Oct 7, 2024
1 parent 2a53e33 commit 7d8f206
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions fortran/src/p0005.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ module Problem0005
contains
integer function p0005() result(answer)
integer(i2t), dimension(20) :: factor_tracker, local_factor_tracker
integer :: i, j, k
integer(i18t) :: p, q
integer :: i, j
answer = 1
factor_tracker = 0
local_factor_tracker = 0
do i = 2, 20
j = i
do while (j > 1)
call prime_factor(j, k)
local_factor_tracker(k) = local_factor_tracker(k) + 1
q = i
do while (q > 1)
call prime_factor(q, p)
local_factor_tracker(p) = local_factor_tracker(p) + 1
end do
do i = 2, 19
factor_tracker(i) = max(factor_tracker(i), local_factor_tracker(i))
local_factor_tracker(i) = 0
do j = 2, 19
factor_tracker(j) = max(factor_tracker(j), local_factor_tracker(j))
local_factor_tracker(j) = 0
end do
end do
do i = 2, 19
Expand Down

0 comments on commit 7d8f206

Please sign in to comment.