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