2013
12-13

# 九度-1207-质因数的个数[解题代码]

120

5

cpp 代码如下：
#include <stdio.h>
#include <math.h>
int main() {
long long n;
while(scanf("%lld",&n) != EOF){
int m = sqrt(n);
int count = 0;
while(n>1){
int i;
for(i=2; i<=m; i++){
if(n%i == 0){
count ++;
n /= i;
break;
}
}
if(i == m+1 && n>1){
count ++;
break;
}
}
printf("%d\n",count);

}

return 0;
}
/**************************************************************
Problem: 1207
User: coder
Language: C
Result: Accepted
Time:20 ms
Memory:920 kb
****************************************************************/

java 代码如下：

import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
static long n;
public static void main(String[] args) {
Scanner s = new Scanner(new BufferedInputStream(System.in));
while(s.hasNextLong()){
n = s.nextLong();
int m = (int) Math.sqrt(n);
int count = 0;
while(n>1){
int i;
for(i=2; i<=m; i++){
if(n%i == 0){
count ++;
n /= i;
break;
}
}
if(i == m+1 && n>1){
count ++;
break;
}
}
System.out.println(count);

}
}

}
/**************************************************************
Problem: 1207
User: coder
Language: Java
Result: Accepted
Time:240 ms
Memory:18800 kb
****************************************************************/

1. 煎蛋的受众都是小学生还是五毛？五毛是美分YY出来的？你知道网络评论员是什么职业吗？美元这种称谓才是五毛杜撰出来的，要不谁来给我举一个美分拿钱发帖的例子，要国内的，多谢了

2. simple, however efficient. A lot of instances it is difficult to get that a??perfect balancea?? among usability and appearance. I must say that youa??ve done a exceptional task with this. Also, the blog masses quite fast for me on Web explore.