for (i = 2; i < num; i++) {
count++;
if (num % i == 0) { // 如果余数为0
function(num / i); // 递归,但是先进后出!!!
System.out.print(num / i + " ");
}
}
}
public void print() {
for (int a = 0; a < x; a++) {
System.out.println(arr[a]);
}
}
/**
* 判断是否是素数
* */
public boolean su(int num) {
int j = 2;
for (j = 2; j < num; j++) {
if (num % j == 0) {
break;
}
}
// 素数返回true
if (num == j) {
return true;
}
return false;
}
}
package M2;
import java.util.Scanner;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
Number n=new Number();
n.function(num);
n.print();