分解质因数模版题

This commit is contained in:
LittleSheep 2024-05-01 14:29:23 +08:00
parent 43af4da056
commit 071dbbe56d

16
factorization/main.cc Normal file
View File

@ -0,0 +1,16 @@
#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;
}