include[HTML_REMOVED]
using namespace std;
bool judge(int x, int y, int z)
{
int a[10] = { 0 };
int k = 0;
a[x / 10] += 1;
a[x % 10] += 1;
a[y % 10] += 1;
a[y / 10 % 10] += 1;
a[y / 100] += 1;
a[z % 10] += 1;
a[z / 10 % 10] += 1;
a[z / 100 % 10] += 1;
a[z / 1000] += 1;
if (a[0] == 0) {//必须要去除0
for (int i = 0; i < 10; i)
{
if (a[i] == 1)
{
k;
}
}
if (k == 9)
return true;
}
return false;
}
int main()
{
int x, y, z;
for (x = 12; x < 99; x)
{
for (y = 123; y < 987; y)
{
z = x * y;
if (z > 9999)
break;
if (judge(x,y,z))
{
cout << x << “*” << y << “=” << z << endl;
}
}
}
return 0;
}