day41 [HackerRank 30 Days of Code] Day 3, Day 4 Day 3 https://www.hackerrank.com/challenges/30-conditional-statements/problem 간단한 조건문 구현이다. 홀수면 'Weird' 짝수이고 2~5면 'Not Weird' 짝수이고 6~20이면 'Weird' 짝수이고 20보다 크면 'Not Weird'를 출력한다. function main() { const N = parseInt(readLine(), 10); const isOdd = N % 2 === 1; if (isOdd) { console.log('Weird'); } else { if((N > 1 && N 20){ console.log('Not Weird'); } else { console.log('Weird'); } } } .. 2020. 7. 7. 이전 1 다음