import java.util.Scanner;
/**
* Created by fhqplzj on 17-1-26 at 下午5:16.
*/
public class My10 {
private static int getNum(int n) {
int result = 0;
while (true) {
int i = 2;
while (i * i <= n) {
if (n % i == 0) {
break;
}
i++;
}
if (n % i == 0) {
result++;
n /= i;
} else {
break;
}
}
return n == 1 ? result : result + 1;
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNextInt()) {
System.out.println(getNum(scanner.nextInt()));
}
}
}
清华大学 质因数的个数
最新推荐文章于 2020-03-27 15:28:27 发布