输入示例: 2 3 5 4 1 输出示例: [2,3,5,4,1]是[1,2,3,4,5]的出栈序列 |
a = [1, 2, 3, 4, 5]
b = list(map(int, input().split()))
stack = []
i = j = 0
while i < len(a):
stack.append( ① )
i += 1
while len(stack) > 0 and ② :
stack.pop()
j += 1
if len(stack) == 0 and i == j == len(a):
print(b, '是', a, '的出栈序列')
else:
print(b, '不是', a, '的出栈序列')
划线处应填写的语句是( )