题解 | #质数因子#
质数因子
http://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long num = scanner.nextLong();
for (long i = 2; i * i <= num; i++) {
while (num % i == 0) {
num /= i;
System.out.print(i + " ");
}
}
if (num != 1) {
System.out.println(num);
}
}
}