Răspuns:
#include <iostream>
using namespace std;
int main()
{
unsigned int p1,p2,a,b,c,d,e,f,g,X;
long long i;
do
{
cout<<"p1=";
cin>>p1;
cout<<"p2=";
cin>>p2;
}while(p1>81 || p2>81 || p1<1 || p2<1);
for(i=9999999;i>1000000;i--)
{
X=i;
g=X%10;
X=X/10;
f=X%10;
X=X/10;
e=X%10;
X=X/10;
d=X%10;
X=X/10;
c=X%10;
X=X/10;
b=X%10;
X=X/10;
a=X%10;
X=X/10;
if(a*b==p1 && c==d && d==e && f*g==p2)
cout<<i<<" ";
}
return 0;
}
Explicație:
5 stele+multumesc+cel mai inteligent raspuns?