From 3536f9cea3d960c9b2ad31340c0f2b73057870f4 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Tue, 1 Oct 2024 02:10:25 -0500 Subject: [PATCH] Attempt p76 in fortran (2) --- fortran/src/p0076.f90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fortran/src/p0076.f90 b/fortran/src/p0076.f90 index 39439e77..bd794b30 100644 --- a/fortran/src/p0076.f90 +++ b/fortran/src/p0076.f90 @@ -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