题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
import sys
import re
str = input()
if len(str) < 8:
num = 8 - len(str)
print(str + "0" * num)
else:
a = len(str) % 8
if a != 0:
str = str + "0" * (8-a)
st1 = re.findall(r'.{8}', str)
for i in st1:
print(i)
查看9道真题和解析
