题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here while(line = await readline()){ let len = line.length; for (let i = 0;i<len;i+=8){ let substr = line.substring(i,i + 8); if(substr.length == 8){ console.log(substr) } else{ console.log(substr.padEnd(8,'0')) } } } }()