队列先进先出

单选题 难度 2

#queue#stl

排队买票,先来先走。

题目

下面代码的输出是( )。

queue<int> q;
q.push(1); q.push(2); q.push(3);
q.pop();
cout << q.front() << " " << q.size() << endl;
  1. 2 2
  2. 1 2
  3. 3 2
  4. 2 3
来小码星球,动手写一遍 →