题解 | 单词倒排
import re def re_word(n): sig_word = re.split(r'[^a-zA-Z]+', n) # words = re.split(r'[^a-zA-Z]+', text) final_word = [] x =len(sig_word) for i in range(x-1): final_word.append(sig_word[x-i-1]) return " ".join(final_word) n = input().strip() print(re_word(n))