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

[๋ฐฑ์ค€][Node.js] 2420๋ฒˆ : ์‚ฌํŒŒ๋ฆฌ์›”๋“œ

by ๐Ÿ‡๋ฐ•๋ด‰๋ด‰๐Ÿ‡ 2021. 8. 2.

 

 

Algorithm

-  ์‚ฌํŒŒ๋ฆฌ์›”๋“œ -

 


 

๋ฌธ์ œ

์‚ฌํŒŒ๋ฆฌ์›”๋“œ๋Š” ์ธํ„ฐ๋„ท์œผ๋กœ๋งŒ ์กด์žฌํ•˜๋Š” ๋ฏธ์Šคํ…Œ๋ฆฌํ•œ ๋‚˜๋ผ์ด๋‹ค.

์‚ฌํŒŒ๋ฆฌ์›”๋“œ์—๋Š” 2๊ฐœ์˜ ์„œ๋ธŒ๋„๋ฉ”์ธ์ด seunghwan.royal.gov.sw์™€ kyuhyun.royal.gov.sw ์ด ์žˆ๋Š”๋ฐ, ์ด๊ฒƒ์ด couple.royal.gov.sw์œผ๋กœ ํ•ฉ์ณ์งˆ ๊ฒƒ์ด๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ ๋„๋ฉ”์ธ ๊ด€๋ฆฌ ์„ผํ„ฐ SWNIC(์„ผํ„ฐ์žฅ: ๊น€๋™๊ทœ)์—๋Š” ์—„๊ฒฉํ•œ ๋ฃฐ์ด ์žˆ๋‹ค.

๋‘ ์„œ๋ธŒ๋„๋ฉ”์ธ์„ ํ•ฉ์น  ๋•Œ, ์œ ๋ช…๋„์˜ ์ฐจ์ด๊ฐ€ ๋„ˆ๋ฌด ์ฐจ์ด๋‚˜์ง€ ์•Š์„ ๊ฒฝ์šฐ์—๋งŒ ๋‘ ์„œ๋ธŒ๋„๋ฉ”์ธ์„ ๊ฒฐํ˜ผ์‹œํ‚ค๋Š” ๊ฒƒ์ด๋‹ค.

์„œ๋ธŒ๋„๋ฉ”์ธ์˜ ์œ ๋ช…๋„๋Š” ์ •์ˆ˜์ด๋‹ค.

๋‘ ์„œ๋ธŒ๋„๋ฉ”์ธ์˜ ์œ ๋ช…๋„๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, ๊ทธ ์ฐจ์ด๋ฅผ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

 

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

 

๋ฌธ์ œ ํ’€๊ธฐ

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

console.log(Math.abs(input[0] - input[1]));

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€