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