题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
while True:
try:
str_input=input()
str_list=list(str_input)
n=len(str_list)
if n >=8:
a=int(n/8)
b=n%8
re=[]
for i in range(a):
c=[]
for j in range(8):
c.append(str_list[i*8+j])
d1="".join(c)
print(d1)
if b==0:
break;
else:
c=[]
for k in range(b):
c.append(str_list[a*8+k])
e=8-b;
for l in range(e):
c.append('0');
d2="".join(c)
print(d2)
else:
b=n%8
c=[]
for k in range(b):
c.append(str_list[k])
e=8-b;
for l in range(e):
c.append('0');
d3 ="".join(c)
print(d3)
except:
break;