Untitled

mail@pastecode.io avatar
unknown
plain_text
22 days ago
217 B
3
Indexable
Never
int main() {

int range;

cin >> range;

for(int i=1;i<=range;i++){

sieve[i] = 1;

}

sieve[1] = 0;

for(int i=1;i<=range;i++){ if(sieve[i]==1){ cout << i << " "; for(int j=1*2;j<=range;j+=1){ sieve[j] = 0; } }

}

}
Leave a Comment