题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
s = input()
w, lst = '', []
for i, c in enumerate(s):
if 65 <= ord(c) <= 90 or 97 <= ord(c) <= 122:
w += c
if i == len(s)-1:
lst.append(w)
else:
if w:
lst.append(w)
w = ''
for w in reversed(lst):
print(w, end=' ')