print queue c 2b 2b

Solutions on MaxInterview for print queue c 2b 2b by the best coders in the world

showing results for - "print queue c 2b 2b"
Célestin
03 Apr 2020
1#include <queue>
2#include <iostream>
3
4void print_queue(std::queue q)
5{
6  while (!q.empty())
7  {
8    std::cout << q.front() << " ";
9    q.pop();
10  }
11  std::cout << std::endl;
12}
13
14int main()
15{
16  std::queue<int> q;
17  for (auto i : {1,2,3,7,4,9,7,2,4}) q.push(i);
18  print_queue(q);
19}
20