python

字符串分隔

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

def solution():
count = 2
for i in range(count):
strs = list( input() )
if len(strs) == 0:
print()
continue
n = len(strs)
t = n - 8
while t >= 0:
print(''.join(strs[:8]))
strs = strs[8:]
t = t - 8
if strs:
s = strs
for j in range(len(strs),8):
s.append('0')
print(''.join(s))
if name == 'main':
solution()

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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