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