描述
•输入一个字符串,请按长度为8拆分每个输入字符串并进行输出;
•长度不是8整数倍的字符串请在后面补数字0,空字符串不处理。
输入描述:
连续输入字符串(每个字符串长度小于等于100)
输出描述:
依次输出所有分割后的长度为8的新字符串
示例1
输入:
abc
复制
输出:
abc00000
def eightStr(in_str):
ins = in_str
if len(ins) > 8:
print(ins[0:8])
eightStr(ins[8:len(ins)])
elif len(ins) < 8 :
temp = 8 - len(ins) % 8
res = ins + '0' * temp
print(res)
elif len(ins) == 8:
print(ins)
# in_str = 'jc'
in_str = input()
eightStr(in_str = in_str)