Skip to content

Commit

Permalink
09.07: math(Pyramids)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Sep 7, 2024
1 parent d7ac486 commit 3d5c6ac
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions baekjoon/5341.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Pyramids : 수학
const input = require("fs")
.readFileSync(0, "utf-8")
.trim()
.split("\n")
.map((v) => +v);
const answer = [];

for (const elem of input) {
if (elem === 0) {
break;
}
answer.push((elem * (elem + 1)) / 2);
}

console.log(answer.join("\n"));

0 comments on commit 3d5c6ac

Please sign in to comment.