题解 | 字符串分隔

字符串分隔

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) {
    if(line.length%8!=0) {
        line = line +'00000000'.slice(0,8-line.length%8)
    }
    const y = (t)=>{
        console.log(t.slice(0,8))
        if(t.length>8){
            y(t.slice(8))
        }
    }
    y(line)
});

#电网笔面经互助##你面试被问到过哪些不会的问题?##为了求职,我做过的疯狂伪装##晒晒你的中秋福利##bilibili求职进展汇总#
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务