题解 | #字符串分隔#

字符串分隔

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

a = input()
length = len(a)
times = int(length / 8)
last = length % 8
zero="0000000"
if last == 0:
    for i in range(times):
        print(a[8*i:8*i+8])
else:
    for i in range(times):
        print(a[8*i:8*i+8])
    print(a[8*times:]+zero[0:(8-last)])

b = 1

全部评论

相关推荐

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