문제
9086번: 문자열
입력의 첫 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 10)가 주어진다. 각 테스트 케이스는 한 줄에 하나의 문자열이 주어진다. 문자열은 알파벳 A~Z 대문자로 이루어지며 알파벳 사이에 공백은 없으
www.acmicpc.net
정답
let fs = require("fs");
let filePath = process.platform === "linux" ? "/dev/stdin" : "test.txt";
let input = fs.readFileSync(filePath).toString().split("\n");
for (let i = 1; i <= Number(input[0]); i++) {
console.log(input[i].substring(0, 1) + input[i].substring(input[i].length - 1, input[i].length));
}
let fs = require("fs");
let filePath = process.platform === "linux" ? "/dev/stdin" : "test.txt";
let input = fs.readFileSync(filePath).toString().split("\n");
input.shift();
input.map(x => console.log(x.substring(0, 1) + x.substring(x.length - 1, x.length)));