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