Jayden`s
[JS] 8958
const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; const input = fs.readFileSync(path).toString().trim().split('\n'); function solve(input) { const count = Number(input[0]); for (i = 1; i
[JS] 4344
const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; const input = fs.readFileSync(path).toString().trim().split('\n'); function solve(input) { const caseCount = Number(input[0]); for (let i = 1; i Number(x)); let studentCount = arrTemp.shift(); let avgScore = arrTemp.reduce((acc, cur) => acc + cur) / studentC..
[JS] 1110
const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = Number(fs.readFileSync(path).toString()); function solve(input) { let firstInput = input; let i = 0; while (true) { let numberSum = Math.floor(input / 10) + (input % 10); input = (input % 10) * 10 + (numberSum % 10); i++; if (input === firstInput) { retu..
[JS] 10951
const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; const input = fs.readFileSync(path).toString().trim().split('\n'); function solve(input) { const count = input.length; for (let i = 0; i < count; i++) { let numbers = input[i].split(' ').map(Number); console.log(numbers[0] + numbers[1]); } } solve(in..
[JS] 'use strict';
์๋ฐ์คํฌ๋ฆฝํธ๋ ๋งค์ฐ ์ ์ฐํ๊ณ ์์ ๋ก์ด ์ธ์ด์ด๋ค. ์์ ๋ง๋ง ๋ณด๋ฉด ๊ธ์ ์ ์ธ ์ฅ์ ์ผ๋ก๋ง ๋น์ถฐ์ง์ง๋ง ๋ค์ ๋งํด ์๊ฒฉํ ์ ์ฝ์ด ์๋ค๋ ์๋ฏธ์ด๋ค. ์ฆ, ์์ ๋๊ฐ ๋์ ๋งํผ ์ด๋ ํ ์๋ฌ๊ฐ ๋ฐ์ํ ์ง ์ ์ ์๋ค.(์ฌ์ ์ ์ฝ์๋ ์ ์ฝ์ด ์ ์ ํธ์ด๊ธฐ ๋๋ฌธ) ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ECMAScript5์์ ๋ฑ์ฅํ ๊ฐ๋ ์ด 'use strict' ์์1) a = 10; console.log(a); // 10 ์ถ๋ ฅ ์์2) 'use strict'; a= 10; console.log(a); // 'ReferenceError: a is not defined'๋ก error ๋ฐ์ ์ฆ, ๊ธฐ์กด JS์ ๋์ ์์ ๋๋ก ์ธํด ๋ฐ์ํ๋ ์๋ฌ๋ฅผ ์ค์ด๊ธฐ ์ํด ์ ์ฝ์ ๊ฑธ์ด์ฃผ๋ ๊ฒ์ด๋ค. ๋ณ๊ฑฐ ์๋ ์ ์์ง๋ง, ์ถํ ์ฝ๋์ ๋ณต์ก๋๊ฐ ์ฌ๋ผ๊ฐ์ ๋ ์ด๋ค ์๋ฌ๋ฅผ..