题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
def func(s):
l = [i if i.isalpha() else ' ' for i in s]
l = ''.join(l).split()[::-1]
print(' '.join(l))
s = input()
func(s)
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
def func(s):
l = [i if i.isalpha() else ' ' for i in s]
l = ''.join(l).split()[::-1]
print(' '.join(l))
s = input()
func(s)
相关推荐