diff options
| author | kittobi1992 <kittobi1992@users.noreply.github.com> | 2014-11-21 16:07:24 +0100 |
|---|---|---|
| committer | kittobi1992 <kittobi1992@users.noreply.github.com> | 2014-11-21 16:07:24 +0100 |
| commit | f0ca9a96291d0cc2d1af337ca4d6838339f94539 (patch) | |
| tree | 423609568db7c947581ed4b30a22eb568f247690 /math/primeSieve.cpp | |
| parent | 0fb5b77d3faf56b8c1d83516256f359086f3addd (diff) | |
Update primeSieve.cpp
Diffstat (limited to 'math/primeSieve.cpp')
| -rw-r--r-- | math/primeSieve.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/math/primeSieve.cpp b/math/primeSieve.cpp index 9981981..c17b626 100644 --- a/math/primeSieve.cpp +++ b/math/primeSieve.cpp @@ -8,7 +8,7 @@ vector<int> primeSieve(int n) { if(i*i <= n) { if(isPrime[i]) { primes.push_back(i); - for(int j = 1; i*j < n; j++) { + for(int j = 2; i*j < n; j++) { isPrime[i*j] = false; } } @@ -21,4 +21,4 @@ vector<int> primeSieve(int n) { i--; } return primes; -}
\ No newline at end of file +} |
