Skip to content

Commit 358c981

Browse files
committed
[Bronze V] Title: 합, Time: 88 ms, Memory: 9336 KB -BaekjoonHub
1 parent 04ed161 commit 358c981

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

백준/Bronze/8393. 합/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# [Bronze V] 합 - 8393
2+
3+
[문제 링크](https://www.acmicpc.net/problem/8393)
4+
5+
### 성능 요약
6+
7+
메모리: 9336 KB, 시간: 88 ms
8+
9+
### 분류
10+
11+
구현, 수학
12+
13+
### 제출 일자
14+
15+
2025년 3월 8일 06:47:55
16+
17+
### 문제 설명
18+
19+
<p>n이 주어졌을 때, 1부터 n까지 합을 구하는 프로그램을 작성하시오.</p>
20+
21+
### 입력
22+
23+
<p>첫째 줄에 n (1 ≤ n ≤ 10,000)이 주어진다.</p>
24+
25+
### 출력
26+
27+
<p>1부터 n까지 합을 출력한다.</p>
28+

백준/Bronze/8393. 합/합.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const fs = require('fs');
2+
const input = fs.readFileSync("/dev/stdin").toString().split("\n");
3+
4+
const num = input[0];
5+
6+
let sum = 0;
7+
for (let i = 1; i<= num; i += 1) {
8+
sum += i;
9+
}
10+
11+
console.log(sum);

0 commit comments

Comments
 (0)