You are viewing a single comment's thread. Return to all comments →
#include #include #include #include #include #include #include using namespace std;
int main() { queue q1; int q, type, x; cin >> q;
for(int i = 0; i < q; i++) { cin >> type; if(type == 1) { cin >> x; q1.push(x); } else if(type == 2) { q1.pop(); } else cout << q1.front() << endl; } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0;
} 30.
Seems like cookies are disabled on this browser, please enable them to open this website
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
#include #include #include #include #include #include #include using namespace std;
int main() { queue q1; int q, type, x; cin >> q;
} 30.