题目如下:
Your task is to find the minimal positive integer number
Q so that the product of digits of
Q is exactly equal to
N.
Input
The input contains the single integer number
N (0 ≤
N ≤ 10
9).
Output
Your program should print to the output the only number
Q. If such a number does not exist print −1.
Sample
input | output |
---|---|
10 | 25 |
题目比较简单,求各位数相乘等于给定数的最小数。 要注意给0的情况,按题意,结果不是0也不是-1,而是10,因为这个错了WE N次。
代码: