數的分解
時間限制:1000 ms | 記憶體限制:65535 KB
難度:1
描述
你的任務是找到一個最小的正整數Q,使Q的各位數的乘積等于N。
輸入
最多450組測試資料。資料以EOF結尾。
輸入一個整數N(0 ≤ N ≤ 400)。
輸出
輸出Q,如果Q不存在則輸出−1。
樣例輸入
10
5
樣例輸出
25
5
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
for(int b=1;b<10;b++){
for(int c=0;c<10;c++){
if(b*c==a){
System.out.print(b+""+c);
return;
}
}
}
}