a=[] # 循环读取输入,直到输入为 "0" 为止 while True: # 如果输入为 "0",结束输入循环 if (i := input()) == '0': break # 当输入不为0时,将单词添加到列表中 else: a.append(i) print(" ".join(a))