题解 | #表示数字#

表示数字

http://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6

while True:
    try:
        s = input()
        s += ' '
        k = False
        opt = ''
        for i in range(len(s)):
            if not s[i].isnumeric() and k == False:
                opt += s[i]
            if s[i].isnumeric() and k == False:
                k = True
                opt += '*'
            if s[i].isnumeric() and k == True:
                opt += s[i]
            if not s[i].isnumeric() and k == True:
                k = False
                opt += '*'
                opt += s[i]
        print(opt)
    except:
        break
全部评论

相关推荐

醉蟀:你不干有的是人干
点赞 评论 收藏
分享
流浪的神仙:无恶意,算法一般好像都得9硕才能干算法太卷啦
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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