苏燕 @ 2020-02-06 18:39:51
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int m1=in.nextInt();
int m2=in.nextInt();
int m3=in.nextInt();
int f=0;
for(int a=123;a<999;a++){
int b=a/m1*m2;
int c=a/m1*m3;
if(b>=999||c>=999)break;
String a1=String.valueOf(a);
String b1=String.valueOf(b);
String c1=String.valueOf(c);
if(a>b||a>c||b>c)break;
if(pd(a1,b1,c1)){
if(hj(a,b,c).equals(hj(m1,m2,m3))){
f=1;
System.out.println(a+" "+b+" "+c);
}
}
}
if(f==0){
System.out.println("No!!!");
}
}
private static String hj(int a, int b, int c) {
// TODO Auto-generated method stub
for(int i=a;i>=2;i--){
if(a%i==0&&b%i==0&&c%i==0){
a=a/i;
b=b/i;
c=c/i;
}
}
return String.valueOf(a)+String.valueOf(b)+String.valueOf(c);
}
private static boolean pd(String a1, String b1, String c1) {
// TODO Auto-generated method stub
String s=a1+b1+c1;
for(char i='1';i<='9';i++){
if(s.contains(String.valueOf(i))==false){
return false;
}
}
return true;
}
}