题解 | #字符串分隔#
字符串分隔
http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7
#搞个函数,字符串长度小于8,右边补齐'0' #大于8,就先输出8个,剩下的再调用函数 # import sys def print_str(s): if len(s) <= 8: print(s.ljust(8,'0')) else: print(s[:8]) print_str(s[8:]) while True: try: s = input().strip() print_str(s) except: # print(sys.exc_info()) break