Skip to content

Commit 1617d35

Browse files
[BOJ] 1075 나누기 (B2)
1 parent 3cf1bc4 commit 1617d35

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

서정우/9주차/260226.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const fs = require("fs");
2+
const filePath = process.platform === "linux" ? "/dev/stdin" : "./서정우/input.txt";
3+
const input = fs
4+
.readFileSync(filePath)
5+
.toString()
6+
.trim()
7+
.split("\n")
8+
.map((el) => el.trim());
9+
10+
const num1 = Number(input[0]);
11+
const num2 = Number(input[1]);
12+
13+
const num = Math.floor(num1 / 100);
14+
for (let i = 0; i < 100; i++) {
15+
const num3 = num * 100 + i;
16+
if (num3 % num2 === 0) {
17+
console.log((num3 % 100).toString().padStart(2, "0"));
18+
return;
19+
}
20+
}

서정우/input.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
161 181 762 375
1+
32442
2+
99

0 commit comments

Comments
 (0)