题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
while True:
try:
n = input('')
if len(n)%8 == 0:
n_len = len(n)//8
for i in range(n_len):
a = 8*i
b = 8+8*i
print(n[a:b])
elif len(n) < 8:
c = '0'*(8-len(n))
print(n+c)
elif len(n) > 8 and len(n)%8 != 0:
n_len = len(n) // 8
for j in range(n_len):
d = 8*j
e = 8+8*j
print(n[d:e])
f = '0'*(8-(len(n)%8))
print(n[8*n_len:]+f)
except:
break
海康威视公司福利 1334人发布