From 071dbbe56d0c7c8e802e0c263937e6b8fe8258e3 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 1 May 2024 14:29:23 +0800 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=E5=88=86=E8=A7=A3?= =?UTF-8?q?=E8=B4=A8=E5=9B=A0=E6=95=B0=E6=A8=A1=E7=89=88=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- factorization/main.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 factorization/main.cc diff --git a/factorization/main.cc b/factorization/main.cc new file mode 100644 index 0000000..79b2fbf --- /dev/null +++ b/factorization/main.cc @@ -0,0 +1,16 @@ +#include +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; +}