/** * @des 一个数的最小因子的连乘 * 2*2*2*2*2*2*5*5*5*5*5*5*=1000000 * @param a */ private static void min(int a) { int b =a; StringBuilder stringBuilder = new StringBuilder(); int i = 2; while (true) { if (b % i == 0) { stringBuilder.append(i + "*"); b /= i; } else i++; if (b == 1) break; } System.out.println(stringBuilder.substring(0,stringBuilder.length())+"="+a); }
来源:https://www.cnblogs.com/wushenghfut/p/12637221.html