Advertisement
Patey

Untitled

Jun 3rd, 2020
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4. int p1,p2,d,x,y,z,i,d2,n=0;
  5. int main()
  6. {
  7.     cin>>p1;
  8.     cin>>p2;
  9.     for(d=p1/2;d>=2;d--)
  10.     {
  11.         if(p1%d==0)
  12.         {
  13.             x=0;
  14.             x=d*10+(p1/d);
  15.             for(i=9;i>=0;i--)
  16.             {
  17.                 y=0;
  18.                 y=(y+i)*100+(y+i)*10+i;
  19.                 for(d2=p2/2;d2>=2;d2--)
  20.                 {
  21.                     if(p2%d2==0)
  22.                     {
  23.                     z=0;
  24.                     z=d2*10+(p2/d2);
  25.                     n=x*100000+y*100+z;
  26.                     cout<<n<<endl;
  27.                     }
  28.                 }
  29.             }
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement