题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
words = input()
re =[]
ss=''
for i in range(len(words)):
if 'a'<= words[i] <='z' or 'A'<= words[i] <='Z':
ss += words[i]
else:
if ss != '':
re.append(ss)
ss = ''
if i == len(words)-1:
re.append(ss)
for i in re[::-1]:
print(i, end=' ')