yoyoSGH @ 2024-05-30 17:27:28
#include<bits/stdc++.h>
using namespace std;
int main() {
int a,b,c,mall=0;
cin>>a>>b>>c;
for(int i=123;i<=333;i++)
{
int x[3],y[3],z[3];
x[0]=a*i/100;
x[1]=a*i/10%10;
x[2]=a*i%10;
//
y[0]=b*i/100;
y[1]=b*i/10%10;
y[2]=b*i%10;
//
z[0]=c*i/100;
z[1]=c*i/10%10;
z[2]=c*i%10;
if(x[0]+x[1]+x[2]+y[0]+y[1]+y[2]+z[0]+z[1]+z[2]==45&&x[0]*x[1]*x[2]*y[0]*y[1]*y[2]*z[0]*z[1]*z[2]==1*2*3*4*5*6*7*8*9)
{
cout<<x[0]<<x[1]<<x[2]<<' ';
cout<<y[0]<<y[1]<<y[2]<<' ';
cout<<z[0]<<z[1]<<z[2]<<' ';
cout<<endl;
mall=1;
}
}
if(mall==0) cout<<"No!!!";
return 0;
}
by cdxxmashaoyang @ 2024-05-30 17:40:56
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i,j,k,a[10]={0},x,y,z,t=0;
scanf("%d%d%d",&x,&y,&z);
for(i=1;i<987;i++)
{
if(x*i<=987)
{
a[x*i%10]++;
a[x*i/10%10]++;
a[x*i/100]++;
}
if(y*i<=987)
{
a[y*i%10]++;
a[y*i/10%10]++;
a[y*i/100]++;
}
if(z*i<=987)
{
a[z*i%10]++;
a[z*i/10%10]++;
a[z*i/100]++;
}
for(j=1;j<=9;j++)
if(a[j]==0)
break;
if(j>=10)
{
printf("%d %d %d\n",x*i,y*i,z*i);
t=1;
}
for(j=1;j<=9;j++)
a[j]=0;
}
if(t==0) printf("No!!!");
return 0;
}