Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int maximp(int a,int b)
- {
- int n,ma=1,i,j;
- for(i=a;i<=b;i++)
- {
- n=1;
- for(j=3;j<=i;j=j+2)
- {
- if(i%j==0)
- {
- n=n*j;
- }
- }
- if(n>i)
- {
- ma=i;
- }
- if(ma==1)
- {
- return 0;
- }
- else
- {
- return ma;
- }
- }
- }
- int main()
- {
- int a,b;
- cin>>a>>b;
- cout<<maximp(a,b);
- return 0;
- }
- pb1 2019
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement