题解 | #表示数字#

表示数字

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
全部评论

相关推荐

牛客26538663...:感觉校园活动太多了,然后可能教育背景这种标题字号有点大
点赞 评论 收藏
分享
牛客你可姐:也不要一味的看公司人数决定工作,比如我前司只有30人,但是已经创立了10年……
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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