Simplified task3

This commit is contained in:
2024-10-26 14:37:41 +03:00
parent 7a6f79283e
commit 1ec171ab0c
3 changed files with 31 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ void Sundaram(bool A[], int N)
i = 1; j = 1;
while ((2 * i * j + i + j) <= N)
{
while (j <= (N - i) / (2 * i + 1))
while ( (N - i) / (2 * i + 1) >= j )
{
A[2 * i * j + i + j] = false;
j++;