Python实现
while True:
try:
string = input()
n = len(string)
# 如果小于8补齐,大于8,先把以8为一组print,之后剩下的就是用0补齐
repeat = n//8
# print(repeat)
while repeat>=0:
if repeat==0 and string:
n = len(string)
print(string+(8-n)*"0")
repeat-=1
else:
print(string[:8])
string = string[8:]
repeat-=1
except:
break