Advertisement
SelinD

ex14

Jun 4th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. void nrdiv(int n,int &d1,int &d2)
  5. {
  6. d2=INT_MIN,d1=INT_MAX;
  7. int d=2,p;
  8. while(n>1)
  9. {
  10. p=0;
  11. while(n%d==0)
  12. {
  13. p++;
  14. n=n/d;
  15. }
  16. if(p>0)
  17. {
  18. if(d>d2) d2=d;
  19. if(d<d1) d1=d;
  20. }
  21. d++;
  22. }
  23. }
  24. int main()
  25. {
  26. int a,b,d1,d2,i;
  27. cin>>a>>b;
  28. for(i=a; i<=b; i++)
  29. {
  30. nrdiv(i,d1,d2);
  31. if(d1>=10 && d2<=99) cout<<i<<" ";
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement