题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('line', function (line) { while(line.length) { let str = line.slice(0, 8); const bu = 8 - str.length; if(bu > 0) { for(let i = 0; i < bu; i++) { str += "0" } } line = line.slice(8) console.log(str) } });