题解 | #【模板】队列#

【模板】队列

http://www.nowcoder.com/practice/afe812c80ad946f4b292a26dd13ba549

n=int(input())
ls1=[]
while n:
    ls2=input().split(' ')
    if len(ls2)>1:
        ls1.append(int(ls2[1]))
    if len(ls2)==1:
        if ls1==[]:
            print('error')
        elif ls2[0]=='pop':
            print(ls1.pop(0))
        elif ls2[0]=='front':
            print(ls1[0])
    n-=1
全部评论
你这个就过不了,误导人
点赞 回复 分享
发布于 2024-04-22 18:05 陕西

相关推荐

不愿透露姓名的神秘牛友
07-04 18:25
点赞 评论 收藏
分享
评论
4
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务