๐Ÿ’› JavaScript/๋ฐฑ์ค€

๐Ÿ’› JavaScript/๋ฐฑ์ค€

    [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(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./input.txt&#39;; const input = fs.readFileSync(path).toString().trim().split(&#39;\n&#39;); function solve(input) { const count = input.length; for (let i = 0; i < count; i++) { let numbers = input[i].split(&#39; &#39;).map(Number); console.log(numbers[0] + numbers[1]); } } solve(in..

    [JS] 10871

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./input.txt&#39;; const input = fs.readFileSync(path).toString().split(&#39;\n&#39;); const firstRow = input[0].split(&#39; &#39;).map(Number); const secondRow = input[1].split(&#39; &#39;).map(Number); const N = firstRow[0]; const X = firstRow[1]; const array = secondRow; function s..