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