Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- void show(queue <string> qt)
- {
- while(!qt.empty())
- {
- cout<<qt.front()<<endl;
- qt.pop();
- }
- }
- void show(queue <int> qt)
- {
- while(!qt.empty())
- {
- cout<<qt.front()<<endl;
- qt.pop();
- }
- }
- int main()
- {
- queue <string> q;
- q.push("ashraful");
- q.push("alam");
- q.push("giash");
- cout<<q.size() <<endl;
- cout<<q.front()<<endl;
- cout<<q.back();
- cout<<endl;
- cout<<q.empty();
- cout<<endl;
- //q.pop();
- cout<<q.front();
- cout<<endl;
- cout<<endl;cout<<endl;
- show(q);
- cout<<endl;
- cout<<endl;cout<<endl;
- queue <int> q1;
- for(int i=0;i<10; i++)
- q1.push(i);
- show(q1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement