✅ 分解质因数模版题
This commit is contained in:
parent
43af4da056
commit
071dbbe56d
16
factorization/main.cc
Normal file
16
factorization/main.cc
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user