题解 | #字符串分隔#

字符串分隔

http://www.nowcoder.com/practice/d9162298cb5a437aad722fccccaae8a7

1.获取输入
2.分隔字符串输出
def cutStr():
    while True:
        try:
            s = input()
            while len(s) > 8:
                print(s[0:8])
                s = s[8:]
            if len(s) == 0:
                pass
            else:
                print(s+'0'*(8-len(s)))
        except:
            break
            
if __name__ == "__main__":
    cutStr()

全部评论

相关推荐

点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务