BUG
2024-07-30 18:34:33
发布于:浙江
12阅读
0回复
0点赞
#include<iostream>
using namespace std;
int a,b,c;
void slj(int s){
double x=s*b/a,y=s*c/a;
if(x-int(x)>0||y-int(y)>0) cout<<"No!!!";
else if((s/100) != ((s/10)%10) != (s%10) != (int(x)/100) != ((int(x)/10)%10) != (int(x)%10) != (int(y)/100) != ((int(y)/10)%10) != (int(y)%10)) cout<<s<<" "<<x<<" "<<y<<" ";
else cout<<"No!!!";
}
int main(){
cin>>a>>b>>c;
if(a==0||b==0||c==0) cout<<"No!!!";return 0;
for(int i=1;i<=9;i++){
int sum=i*100;
for(int j=1;j<=9;j++){
sum=i*100;
if(i!=j) sum+=j*10;
for(int k=1;k<=9;k++){
sum=i*100+j*10;
if(k!=i&&k!=j) sum+=k;
slj(sum);
}
}
}
}
这里空空如也
有帮助,赞一个