언젠가는 펼쳐 볼 아카이브
[BOJ] 9086번 - 문자열 본문
사용언어 : javascript - node.js
#제출코드
const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
const input = fs.readFileSync(filePath).toString().trim().split('\n');
const testCaseNum = +input[0];
const testArray = [];
for (let i = 1; i <= testCaseNum; i++) {
testArray.push(input[i].trim());
}
solution(testArray);
function solution(testArray) {
for (let i = 0; i < testArray.length; i++) {
console.log(
`${testArray[i].charAt(0)}${testArray[i].charAt(testArray[i].length - 1)}`
);
}
}
'IT > Baekjoon Oline Judge' 카테고리의 다른 글
[BOJ] 5622번 - 다이얼 (0) | 2023.08.17 |
---|---|
[BOJ] 2908번 - 상수 (0) | 2023.08.17 |
[BOJ] 2743번 - 단어 길이 재기 (0) | 2023.08.17 |
[BOJ] 27866번 - 문자와 문자열 (0) | 2023.08.17 |
[BOJ] 3052번 - 나머지 (0) | 2023.08.16 |