things = [] while 1: inp = input('请输入待完成事项:') if inp == 'END': break else: things.append(inp) print('\n'.join(len(things) > 1 and things[-2::-2] or []))