Playground
#include <iostream> #include <queue> using namespace std; int main() { queue<int> q; for (int i=1; i<=5; i++) q.push(i); //q={1, 2, 3, 4, 5} cout << q.size() << endl; //pechati '5' while (!q.empty()) { cout << q.front() << " "; //pechati '1 2 3 4 5 ' q.pop(); } return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!