题解 | #字符串分隔#
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
import sys for line in sys.stdin: line = line.strip() if line: round = len(line) // 8 #除以8,向下取整 for i in range(0,round): print(line[i*8:i*8+8]) if round*8 != len(line): #判断字符串是否非整数 add_len = (round+1)*8 - len(line) #取余数 print(line[round*8::] + "0"*add_len)