胥小biao丶 @ 2018-01-15 20:33:24
#include<bits/stdc++.h>
using namespace std;
bool book[10];
int cf(int n);
int main()
{
int A,B,C;
cin>>A>>B>>C;
int a,b,c,t=0;
for(a=123;a<=500;a++)
{
memset(book,false,10);
b=a*B/A;
c=a*C/A;
if(cf(a)==1&&cf(b)==1&&cf(c)==1)
{
t=1;
cout<<a<<" " <<b<<" "<<c<<endl;
}
}if(t==0)cout<<"No!!!";
}
int cf(int n)
{
int a,b;
while(n>0)
{
if(book[n%10]!=false||n%10==0)
return 0;
book[n%10]=true;
n/=10;
}
return 1;
}
by 胥小biao丶 @ 2018-01-15 20:47:42
有毒,多提交几次就ac了