Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int p1,p2,d,x,y,z,i,d2,n=0;
- int main()
- {
- cin>>p1;
- cin>>p2;
- for(d=p1/2;d>=2;d--)
- {
- if(p1%d==0)
- {
- x=0;
- x=d*10+(p1/d);
- for(i=9;i>=0;i--)
- {
- y=0;
- y=(y+i)*100+(y+i)*10+i;
- for(d2=p2/2;d2>=2;d2--)
- {
- if(p2%d2==0)
- {
- z=0;
- z=d2*10+(p2/d2);
- n=x*100000+y*100+z;
- cout<<n<<endl;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement