int num = 900;
int one = 1;
StringBuffer sb = new StringBuffer(num + "=");
while(true) {
if (num == one) {
break;
}
one++;
while(num % one == 0) {
sb.append(one + "*");
num = num / one;
one = 1;
break;
}
}
System.out.println(sb.substring(0, sb.length() -1 ));
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |