Input a positive integer N and return a minimum positive integer m (M is at least two digits), so that the product of M is equal to N, for example, input 36, output 49, input 100, output 455, if a certain N does not have such M, return-1. Package hope20141002_01; import Java. util. *; public class Jingdong {public static void main (string [] ARGs) {// todo auto-generated method stubsystem. out. println ("enter a positive integer:"); int K = fun (getstring (); system. out. println ("output smallest positive integer:" + k);} public static integer getstring () {return integer. parseint (new partition (system. in )). nextline ();} public static int fun (INT N1) {int n = N1; string K = ""; if (n <= 9) {return 10 + N ;} fo R (INT I = 9; I> = 2;) {If (N % I = 0) {k + = I; n = N/I; continue ;} elseI --;} Int J = 0; int n2 = 1; while (j <K. length () {n2 = n2 * integer. parseint (K. charat (j) + ""); j ++;} If (N2! = N1) {return-1;} string temp = ""; for (INT I = K. length ()-1; I> = 0; I --) {temp + = K. charat (I);} return integer. parseint (temp );}}
Input a positive integer N and return a minimum positive integer m (M is at least two digits), so that the product of M is equal to N, for example, input 36, output 49, input 100, output 455, if a certain N does not have such M, return-1.