Skip to content

Commit

Permalink
합성수 찾기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Apr 23, 2023
1 parent 990483b commit 5c1ef85
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Programmers/exam58.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function solution(n) {
let answer = 0;
for (let i = 1; i <= n; i++) {
let cnt = 0;
for (let j = 1; j <= i; j++) {
if (i % j === 0) {
cnt++;
}
}
if (cnt >= 3) {
answer++;
}
}
return answer;
}

0 comments on commit 5c1ef85

Please sign in to comment.