题解 | #质因数的个数#
质因数的个数
https://www.nowcoder.com/practice/20426b85f7fc4ba8b0844cc04807fbd9
#include<iostream> using namespace std; int main(void) { int n; while(cin >> n) { int s = 0; for(int i = 2;i <= n / i;i++) { while(n % i == 0) { s++; n /= i; } } if(n > 1) s++; cout << s << endl; } return 0; }