题解 | #用列表实现队列#
用列表实现队列
https://www.nowcoder.com/practice/cc9e56e0d80d44e5990f76196adb4912
n = int(input()) queue = [1, 2, 3, 4, 5] for _ in range(2): queue.pop(0) print(queue) queue.append(n) print(queue)
用列表实现队列
https://www.nowcoder.com/practice/cc9e56e0d80d44e5990f76196adb4912
n = int(input()) queue = [1, 2, 3, 4, 5] for _ in range(2): queue.pop(0) print(queue) queue.append(n) print(queue)
相关推荐