From 5da39575b7f68f656652f968bd2fe2824120758d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 21 Nov 2024 05:05:21 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=8A=88=20#353=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=86=94=EB=A3=A8=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\354\210\230_\354\260\276\352\270\260.cpp" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "Programmers/\355\225\251\354\204\261\354\210\230_\354\260\276\352\270\260.cpp" diff --git "a/Programmers/\355\225\251\354\204\261\354\210\230_\354\260\276\352\270\260.cpp" "b/Programmers/\355\225\251\354\204\261\354\210\230_\354\260\276\352\270\260.cpp" new file mode 100644 index 0000000..714f884 --- /dev/null +++ "b/Programmers/\355\225\251\354\204\261\354\210\230_\354\260\276\352\270\260.cpp" @@ -0,0 +1,28 @@ +#include +#include + +using namespace std; + +int countDivisors(int n) { + int count = 0; + + for (int i = 1; i <= n; i++) { + if (n % i == 0) { + count++; + } + } + + return count; +} + +int solution(int n) { + int answer = 0; + + for (int i = 1; i <= n; i++) { + if (countDivisors(i) >= 3) { + answer++; + } + } + + return answer; +} \ No newline at end of file