mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 13:31:21 +03:00
fixed error when n=5000
This commit is contained in:
parent
747a50d3ca
commit
feaf57d4a3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user