Skip to content

Commit

Permalink
Attempt p76 in fortran (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Oct 3, 2024
1 parent be10a07 commit 3536f9c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fortran/src/p0076.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ integer function p0076() result(answer)
counts(i) = 0
end do
counts(2) = 100
do while (not(counts(100)))
counts(2) = counts(2) + 2
do while (.not. counts(100))
counts(2) = counts(2) + 2_i2t
if (sum >= 100) then
answer = answer + (100 + counts(2) - sum) / 2
idx = 2
do
counts(idx) = 0
idx = idx + 1
idx = idx + 1_i2t
counts(idx) = counts(idx) + idx
sum = counts(2)
do i = 3, 99
sum += counts(i)
sum = sum + counts(i)
end do
if (sum > 100) then
exit
end if
end do
counts(2) = 100 - sum - (sum % 2)
counts(2) = 100 - sum - mod(sum, 2)
end if
sum = counts(2)
do i = 3, 99
Expand Down

0 comments on commit 3536f9c

Please sign in to comment.