Advertisement
Denistod

Untitled

Nov 16th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int maximp(int a,int b)
  4. {
  5. int n,ma=1,i,j;
  6. for(i=a;i<=b;i++)
  7. {
  8. n=1;
  9. for(j=3;j<=i;j=j+2)
  10. {
  11. if(i%j==0)
  12. {
  13. n=n*j;
  14. }
  15. }
  16. if(n>i)
  17. {
  18. ma=i;
  19. }
  20. if(ma==1)
  21. {
  22. return 0;
  23. }
  24. else
  25. {
  26. return ma;
  27. }
  28. }
  29. }
  30. int main()
  31. {
  32. int a,b;
  33. cin>>a>>b;
  34. cout<<maximp(a,b);
  35. return 0;
  36. }
  37. pb1 2019
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement