题解 | #单词倒排#
单词倒排
https://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
a = input() temp = '' for i in a: if ord('a') <= ord(i) <= ord('z'): temp += i elif ord('A') <= ord(i) <= ord('Z'): temp += i else: temp += ' ' temp = temp.split(' ') for i in temp[::-1]: print(i, end=' ')