언젠가는 펼쳐 볼 아카이브

[BOJ] 25314번 - 코딩은 체육과목 입니다 본문

IT/Baekjoon Oline Judge

[BOJ] 25314번 - 코딩은 체육과목 입니다

개발자희망생고롸파덕 2023. 8. 16. 17:28

사용언어 : javascript - node.js

 

# 제출 코드

const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
let input = fs.readFileSync(filePath).toString().trim();

solution(input);

function solution(input) {
  const inputByte = Math.floor(+input / 4);
  const typeString = 'long ';
  let resultString = '';

  for (let i = 0; i < inputByte; ++i) {
    resultString += typeString;
  }

  console.log(`${resultString}int`);
}

 

'IT > Baekjoon Oline Judge' 카테고리의 다른 글

[BOJ] 11201번 - A+B - 7  (0) 2023.08.16
15552번 - 빠른 A+B  (0) 2023.08.16
[BOJ] 25304번 - 영수증  (0) 2023.08.16
[BOJ] 10950번 - A+B - 3  (0) 2023.08.16
[BOJ] 2480번 - 주사위 세개  (0) 2023.08.15