Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- // your code here
- int n=1e8;
- vector<int> lp(n+1,true);
- // for(int i=0;i<=n;i++ ) lp[i]=i;
- for(int i=2;i<=n;i++ ){
- if(lp[i]==true) {
- for(int j=i*i;j<=n;j+=i) {
- lp[j]=false;
- }
- }
- }
- for(int i=2;i<=n;i++) {
- if(lp[i]==true) {
- if(i%100==1) cout<<i<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement