约 10 分钟
C++ 有现成的队列 queue。queue<int> q; q.push(5); 入队,q.front() 看队头,q.pop() 出队。要写 #include <queue>。队头是最早进来的那个。
queue
queue<int> q; q.push(5);
q.front()
q.pop()
#include <queue>
q.push(3); q.push(7); 之后,q.front() 是几?
q.push(3); q.push(7);
登录 后可看答案