题解 | #字符串分隔#

字符串分隔

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

import sys
str_1 = input("")
if len(str_1) <= 100:
    if len(str_1) == 8:
        print(str_1)
    else:
        for i in range(len(str_1)//8+1):
            if len(str_1) > 8:
                str_2 = str_1[:8]
                print(str_2)
                str_1 = str_1[8:]
        else:
            for j in range(8-len(str_1)):
                str_1 = str_1 + "0"
            print(str_1)
else:
    print("请输入小于等于100字符串")

全部评论

相关推荐

投递亚信科技(中国)有限公司等公司6个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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