๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ์ธ๊ณต๋ถ€/Algorithm

[๋ฐฑ์ค€][Node.js] 2754๋ฒˆ : ํ•™์ ๊ณ„์‚ฐ

by ๐Ÿ‡๋ฐ•๋ด‰๋ด‰๐Ÿ‡ 2021. 9. 23.

 

 

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();
});

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€