题解 | #单词倒排#xdjy2
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
while True: try: str1=input() list1=list() stack=list() for i in str1: if i.isalpha(): stack.append(i) else: if len(stack)!=0: list1.append("".join(stack)) stack=[] if len(stack)!=0: list1.append("".join(stack)) stack=[] list2=list1[::-1] print(" ".join(list2)) except: break