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

[๋ฐฑ์ค€][Node.js] 5988๋ฒˆ : ํ™€์ˆ˜์ผ๊นŒ ์ง์ˆ˜์ผ๊นŒ

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

 

 

Algorithm

-  ํ™€์ˆ˜์ผ๊นŒ ์ง์ˆ˜์ผ๊นŒ -

 


 

๋ฌธ์ œ

์ง์ด ์—†๋Š” ๊ฒฝ์žฌ๋Š” ๋งค์ผ ํ™€๋กœ ์žˆ๋‹ค๋ณด๋‹ˆ ํ™€์ˆ˜๋ฅผ ํŒ๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๋Šฅ๋ ฅ์ด ์ƒ๊ฒผ๋‹ค. ์ฐฝ์‹์ด๋Š” ๊ฒฝ์žฌ์˜ ๋ง์ด ์‚ฌ์‹ค์ธ์ง€ ๊ทธ ๋Šฅ๋ ฅ์„ ์‹œํ—˜ํ•ด๋ณด๋ ค ํ•œ๋‹ค. ์ฐฝ์‹์ด์˜ ์˜์‹ฌ์ด ๋์ด ์—†์„ ๊ฒƒ ๊ฐ™์•„ N๊ฐœ๋งŒ ํ™•์ธํ•˜๊ธฐ๋กœ ์ •ํ–ˆ๋‹ค.

 

N๊ฐœ์˜ ์ •์ˆ˜๊ฐ€ ์ฃผ์–ด์ง€๋ฉด ํ™€์ˆ˜์ธ์ง€ ์ง์ˆ˜์ธ์ง€๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค์–ด ๊ฒฝ์žฌ์˜ ๋Šฅ๋ ฅ์„ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ฃผ์ž.

 

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

 

๋ฌธ์ œ ํ’€๊ธฐ

const readline = require("readline");
const rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
});
let input = [];
rl.on("line", function (line) {
	input.push(BigInt(line));
}).on("close", function () {
    for(let i = 1; i < input.length; i++) {
    	if(Number(String(input[i]).slice(-1)) % 2 === 0) {
    		console.log('even');
    	}
    	else console.log('odd');
    }
	process.exit();
});

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€