Algorithm
- ํ์ ๊ณ์ฐ -
๋ฌธ์
์ด๋ค ์ฌ๋์ C์ธ์ด ์ฑ์ ์ด ์ฃผ์ด์ก์ ๋, ํ์ ์ ๋ช ์ ์ธ์ง ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
A+: 4.3, A0: 4.0, A-: 3.7
B+: 3.3, B0: 3.0, B-: 2.7
C+: 2.3, C0: 2.0, C-: 1.7
D+: 1.3, D0: 1.0, D-: 0.7
F: 0.0
์ ์ถ๋ ฅ ์์
๋ฌธ์ ํ๊ธฐ
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input;
rl.on("line", function (line) {
input = line.toString();
}).on("close", function () {
let obj = {
"A+": 4.3,
"A0": 4.0.toFixed(1),
"A-": 3.7,
"B+": 3.3,
"B0": 3.0.toFixed(1),
"B-": 2.7,
"C+": 2.3,
"C0": 2.0.toFixed(1),
"C-": 1.7,
"D+": 1.3,
"D0": 1.0.toFixed(1),
"D-": 0.7,
"F" : 0.0.toFixed(1),
};
console.log(obj[input]);
process.exit();
});
๋ฐ์ํ
'๊ฐ์ธ๊ณต๋ถ > Algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][Node.js] 2789๋ฒ : ์ ํ ๊ธ์ง (0) | 2021.09.25 |
---|---|
[๋ฐฑ์ค][Node.js] 2775๋ฒ : ๋ถ๋ ํ์ฅ์ด ๋ ํ ์ผ (0) | 2021.09.24 |
[๋ฐฑ์ค][Node.js] 2753๋ฒ : ์ค๋ (0) | 2021.09.21 |
[๋ฐฑ์ค][Node.js] 2750๋ฒ : ์ ์ ๋ ฌํ๊ธฐ (0) | 2021.09.20 |
[๋ฐฑ์ค][Node.js] 2748๋ฒ : ํผ๋ณด๋์น ์ 2 (0) | 2021.09.18 |
๋๊ธ