思路:全排列函数+模拟
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
int a,b,c,p[10]={0,1,2,3,4,5,6,7,8,9};
cin>>a>>b>>c;
int flag=0;
do
{
int x=p[1]*100+p[2]*10+p[3],
y=p[4]*100+p[5]*10+p[6],
z=p[7]*100+p[8]*10+p[9];
if(x*b==y*a&&b*z==c*y&&x*c==z*a)
{
cout<<x<<" "<<y<<" "<<z<<endl;
flag=1;
}
}while(next_permutation(p+1,p+10));
if(!flag)
puts("No!!!");
}