题解 | #字符串分隔#

字符串分隔

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

def split_string_to_length_eight(s):
    while len(s) > 8:
        print(s[:8])
        s = s[8:]
    print(s.ljust(8, '0'))

while True:
    try:
        s = input()
        split_string_to_length_eight(s)
    except EOFError:
        break

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务