Advertisement
Singasking

Untitled

Jan 19th, 2023
904
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     // your code here
  7.     int n=1e8;
  8.     vector<int> lp(n+1,true);
  9. //  for(int i=0;i<=n;i++ ) lp[i]=i;
  10. for(int i=2;i<=n;i++ ){
  11.     if(lp[i]==true) {
  12.         for(int j=i*i;j<=n;j+=i) {
  13.             lp[j]=false;
  14.         }
  15.     }
  16. }
  17. for(int i=2;i<=n;i++) {
  18.     if(lp[i]==true) {
  19.         if(i%100==1) cout<<i<<endl;
  20.     }
  21. }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement