Advertisement
edutedu

pr4

Jan 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n,p,d,dp,i,m;
  8. cout<<"n="; cin>>n;
  9. cout<<"p="; cin>>p;
  10. m=n;
  11. for(d=2; d<=n/2; d++)
  12. {
  13. if(n%d==0)
  14. dp=dp+1;
  15. }
  16. if(dp+2<p)
  17. for(i=2;i<=m/2; i++)
  18. {
  19. if(m%i==0)
  20. cout<<i<<" ";
  21. }
  22. else
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement