题解 | #字符串分隔#

字符串分隔

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'))
   }
}
    }
}()

全部评论

相关推荐

不愿透露姓名的神秘牛友
01-31 04:00
神哥不得了:首先我就是在成都,成都的互联网格外的卷,如果是凭现在的简历的话很难找到大厂,建议再添加一个高质量的项目上去,另外专业技能的话最好是超过每一条的一半
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务