Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y;
- bool isPrime;
- cin >> x >> y;
- if(y < 2) return 0;
- x++;
- if( x < 2) x = 2;
- for( ; x < y; x++){
- isPrime = true;
- for(int j = 2; j <= x / 2; j++){
- if(x % j == 0){
- isPrime = false;
- break;
- }
- }
- if(isPrime)
- cout << x << ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement