题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
递归思路
#建立一个打印的函数,方便后面递归
def deal(str):
n = len(str)
if n == 0:
return False
elif n <= 8:
print(str + (8-n)*'0')
else:
print(str[0:8])
str = str[8:]
deal(str)
while True:
try:
str = input()
deal(str)
except:
break
有不妥之处,请指教留言