We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0856466 commit 843e4c7Copy full SHA for 843e4c7
snippets/cpp/math-and-numbers/sieve-of-eratosthenes.md
@@ -7,12 +7,9 @@ author: dibyam-jalan27
7
8
```cpp
9
#include <vector>
10
-
11
-using namespace std;
12
13
-vector<int> sieve_of_eratosthenes(int n) {
14
- vector<bool> is_prime(n + 1, true);
15
- vector<int> primes;
+std::vector<int> sieve_of_eratosthenes(int n) {
+ std::vector<bool> is_prime(n + 1, true);
+ std::vector<int> primes;
16
is_prime[0] = is_prime[1] = false;
17
for (int i = 2; i * i <= n; ++i) {
18
if (is_prime[i]) {
0 commit comments