题解 | #字符串分隔#

字符串分隔

http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7

while True:
    try:
        inputt = input()
        lenn = len(inputt)
        cishu = lenn//8
        chuyu = lenn%8

        if cishu > 0:
            for i in range(cishu):
                print("".join(list(inputt)[i*8:i*8+8]))
            if chuyu > 0:
                print("".join(list(inputt)[cishu*8:cishu*8+chuyu])+"0"*(8-chuyu))
            else:
                pass
        else:
            print("".join(list(inputt)[cishu*8:cishu*8+chuyu])+"0"*(8-chuyu))
            
    except Exception:
        break
全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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