Eletronic_Monkey @ 2024-12-21 23:51:50
#include<iostream>
using namespace std;
int main()
{
int a, b, c;
bool flag1 = false;//标志位
cin >> a >> b >> c;
for (int i = 100; i <= 999; i++)
{
int n, k, arr[20] = { 0 };
bool flag = true;
if ((i * b % a != 0) || (i * c % a != 0))
{
continue;
}//保证三个数为整数
if ((i * b / a > 999) || (i * c / a > 999))
{
continue;
}//保证在范围之内
n = (i * b / a);
k = (i * c / a);
for(int x=0;x<3;x++)
{
arr[i%10]++;
i /= 10;
}
for (int y = 0; y < 3; y++)
{
arr[n % 10]++;
n /= 10;
}
for (int z = 0; z < 3; z++)
{
arr[k % 10]++;
k /= 10;
}
for (int j = 1; j <= 9; j++)
{
if (arr[j]!=1)
{
flag = false;
break;
}
}
if (flag)
{
cout << i << " " << n << " " << k << endl;
flag1 = true;
}
}
if (flag1)
cout << "NO!!!" ;
return 0;
}