题解 | #栈和队列的实现#
栈和队列的实现
http://www.nowcoder.com/practice/ea35dab9285a44fb901b0cb1ada3f873
list1=[]
list2=[]
for i in range(2):
a=int(input())
list1.append(a)
list2.append(a)
print(list1)
print(list2)
list1.pop()
list2.pop(0)
print(list1)
print(list2)
for i in range(3):
a=int(input())
list1.append(a)
list2.append(a)
print(list1)
print(list2)
while list1:
print(list1[-1],end=' ')
list1.pop()