Skip to content

Commit

Permalink
짝수의 합
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Mar 23, 2023
1 parent 50c17de commit 1ba6314
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Programmers/exam10.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function solution(n) {
let answer = 0;

for (let i = 2; i <= n; i += 2) {
answer += i;
}

return answer;
}

0 comments on commit 1ba6314

Please sign in to comment.