题解 | 字符串分隔

字符串分隔

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

def solve():
    input_str = input().strip()
    str_len = len(input_str)
    count = str_len // 8
    left = str_len % 8
    for i in range(count):
        print(input_str[i * 8 : (i + 1) * 8])
    if left > 0:
        print(input_str[count * 8 :] + "0" * (8 - left))


def main():
    solve()


if __name__ == "__main__":
    main()

大寒节气下雪了,刷道题吧!!

#当发现同事想辞职##工作压力大怎么缓解#
全部评论
点赞 回复 分享
发布于 01-20 10:02 江苏

相关推荐

评论
点赞
收藏
分享

创作者周榜

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