题解 | #单词倒排#

单词倒排

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

in_str = str(input())
out_str = []
mid_str = ""
for i in in_str :
    j = ord(i)
    if 65<=j<=90&nbs***bsp;97<=j<=122:
        mid_str += i
    else:
        if mid_str != "":
            out_str.append(mid_str)
        mid_str = ""
out_str.append(mid_str)
out_str.reverse()#str[::-1]#list.reverse()
print(" ".join(out_str))

全部评论
if 65<=j<=90 or 97<=j<=122:#乱码
点赞 回复 分享
发布于 2022-04-08 12:18

相关推荐

头顶尖尖的程序员:我是26届的不太懂,25届不应该是找的正式工作吗?为什么还在找实习?大四还实习的话是为了能转正的的岗位吗
点赞 评论 收藏
分享
一tiao酸菜鱼:秋招还没正式开始呢,就准备有结果了。。。。?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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