题解 | #字符串分隔#笨办法
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
n = input() i=0 j=7 while True: if i>len(n)-1: break if j<len(n): print(n[i:j+1]) else: for x in range(8-(len(n)-i)): n=n+'0' print(n[i:]) break i+=8 j+=8
字符串分隔
https://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
n = input() i=0 j=7 while True: if i>len(n)-1: break if j<len(n): print(n[i:j+1]) else: for x in range(8-(len(n)-i)): n=n+'0' print(n[i:]) break i+=8 j+=8
相关推荐