Algorithm/factorization/main.cc

17 lines
253 B
C++
Raw Permalink Normal View History

#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int count = 0;
for (int i = 2; i <= N; i++) {
while (i != N) {
if (N % i != 0)
break;
N /= i;
count++;
}
}
cout << count + 1 << endl;
}