Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
SEGMENTED SIEVE
#include<iostream> using namespace std; void simpleSieve(int limit,int primes){ bool mark[limit+1]; memset(mark,true,sizeof(mark); int i,j for(i=2;i*i<limit;i++){ if(mark[i]==true){ for(j=2*i;j<limit;j=j+i) mark[j]=false; } } for(i=2;i<limit;i++){ if(mark[i]==true){ cout<<i; primes.pushback[i]; } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Permute
array, loop, function examples
MAC
static_cast makes a copy
weak_ptr and Circle_reference
My billing system
Mapas - convertir número telefónico
basic caculate ii
Smalllest subarray wiith sum greater than x
Изволов#8
Please log in to post a comment.