题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const array = []
rl.on('line', function (line) {
array.push(line)
});
rl.on('line', ()=>{
array.forEach((item)=>{
while(item.length > 8){
console.log(item.substr(0,8))
item = item.substr(8)
}
console.log(item.padEnd(8, '0'))
})
})