题解 | #将真分数分解为埃及分数#

单词倒排

http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836

终于全部刷完了。。最后一题纪念下自己写吧。。。,虽然弄得很复杂。

while True:
    try:
        s = input()[::-1]
        flag = 1
        res = ''
        for thing in s:
            if not thing.isalpha():
                flag = 0
                continue
            else:
                if flag == 0:
                    res+=' '+thing
                    flag = 1
                else:
                    res+=thing
        res = ' '.join(list(map(lambda x:x[::-1], res.split(' '))))
        print(res)
    except:
        break
全部评论

相关推荐

夕颜不需要停机维护:xd能把idea都写上去那说明是真没得写了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-25 17:13
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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