Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, r, b, prim = 1;
- cin >> n;
- for(r = 1; r<=n; r++) {
- prim = 1;
- if(r < 2)
- prim = 0;
- for(b = 2; b * b <= i; b++) {
- if(i % b == 0)
- prim = 0; }
- if(prim == 1)
- cout<<i<<" "; }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment