fixed error when n=5000

This commit is contained in:
Krishna Vedala 2020-03-29 23:13:01 -04:00
parent 747a50d3ca
commit feaf57d4a3
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -35,11 +35,11 @@ int main(int argc, char* argv[])
{
sieve[j] = 1;
}
sum += i;
// sum += i;
}
}
for (long i = sqrtl(n)+1; i < n; i++)
for (long i = 2; i < n; i++)
if (!sieve[i])
sum += i;