WangYinxiAlex @ 2023-11-11 10:24:35
#include<iostream>
using namespace std;
int u[10];
bool fl=true;
void o(){
for(int i=0;i<10;i++)u[i]=0;
}
void todo(int x){
while(x){
u[x%10]++;
x/=10;
}
}
int m(int x){
int sum;
while(x){
sum++;
x/=10;
}
return sum;
}
int main(){
int a,b,c;
cin>>a>>b>>c;
for(int i=1;i<=987;i++){
bool f=true;
o();
int ib=i*b,ic=i*c;
todo(i);
todo(ib);
todo(ic);
if(a){
if(ib%a!=0)continue;
if(ic%a!=0)continue;
}
if(u[0]!=0)continue;
for(int j=1;j<10;j++){
if(u[j]!=1){
f=false;
}
}
if(f){
cout<<i<<" "<<ib<<" "<<ic<<endl;
fl=false;
}
}
if(fl)cout<<"No!!!"<<endl;
return 0;
}
by kelsie @ 2024-02-01 17:03:05
第一个数不能大于333,因为最小比试1:2:3,改一下最小数最大值范围
by WangYinxiAlex @ 2024-03-09 11:13:17
@kelsie 感谢大佬!