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

[๋ฐฑ์ค€][Node.js] 9498๋ฒˆ : ์‹œํ—˜ ์„ฑ์ 

by ๐Ÿ‡๋ฐ•๋ด‰๋ด‰๐Ÿ‡ 2021. 12. 26.

 

 

Algorithm

-  ์‹œํ—˜ ์„ฑ์  -

 


 

๋ฌธ์ œ

์‹œํ—˜ ์ ์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ 90 ~ 100์ ์€ A, 80 ~ 89์ ์€ B, 70 ~ 79์ ์€ C, 60 ~ 69์ ์€ D, ๋‚˜๋จธ์ง€ ์ ์ˆ˜๋Š” F๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

 

์ž…์ถœ๋ ฅ ์˜ˆ์‹œ

 

๋ฌธ์ œ ํ’€๊ธฐ

let fs = require("fs");
let input = fs.readFileSync("/dev/stdin").toString().split(" ");

let a = parseInt(input[0]);

function solution () {
  if(a >= 90 && a <= 100) console.log('A');
  else if(a >= 80 && a <= 89) console.log('B');
  else if(a >= 70 && a <= 79) console.log('C');
  else if(a >= 60 && a <= 69) console.log('D');
  else console.log('F');
}

solution();

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€