ํ”„์—” ๊ณต๋ถ€/๐Ÿซง ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ณต๋ถ€

[๋ฐฑ์ค€/Node.js] 2753๋ฒˆ ํ’€์ด || JavaScript

๋˜์ž๐Ÿ‹ 2023. 2. 21. 12:05
728x90
let input = require('fs').readFileSync('/dev/stdin').toString();

const year = Number(input);
const isLeapYear = (year) => {
    if (year % 4 === 0 && year % 100 !== 0 || year % 400 == 0) {
        console.log(1);
    }
    else console.log(0);
}
isLeapYear(year);

๐Ÿ“Œ ์ฃผ์–ด์ง„ ์กฐ๊ฑด์„ ๋ชจ๋‘ ๋„ฃ์–ด์ค˜์•ผํ•œ๋‹ค.

(์ฒจ์— 400 ๋ฐฐ์ˆ˜ ์•ˆ๋„ฃ์–ด์ค˜์„œ ํ‹€๋ฆผ)

728x90
๋ฐ˜์‘ํ˜•