题解 | #质因数的个数#
质因数的个数
http://www.nowcoder.com/practice/20426b85f7fc4ba8b0844cc04807fbd9
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int i,N;
int count=0;
scanf("%d",&N);
for(i=2;i<=sqrt(N);i++){
while(N%i==0){
N=N/i;
count++;
}
}
printf("%d\n",count+1);
return 0;
}
for循环中N不是一直是120