emmm,20分
查看原帖
emmm,20分
1012241
Dcchen楼主2023/8/29 09:05
#include<bits/stdc++.h>
using namespace std;
int s[10];
void A(int x){
	s[x%10]=1;
	s[x/10%10]=1;
	s[x/100]=1;
}
bool B(int x,int y,int z){
	memset(s,0,sizeof(s));
	if(y>999||z>999)return 0;
	A(x),A(y),A(z);
	for(int i=1;i<=9;i++){
		if(!s[i])return 0;
		return 1;
	}
}
int main(){
	long long a,b,c,x,y,z,k=0;
	cin>>a>>b>>c;
	for(x=123;x<=987;x++){
		if(x*b%a||x*c%a) continue;
		y=x*b/a,z=x*c/a;
		if(B(x,y,z)){
		cout<<x<<" "<<y<<" "<<z<<endl;
		k++;
	    }
	}
	if(k==0) cout<<"No!!!";
	return 0;
} 
2023/8/29 09:05
加载中...