23 lines
446 B
C++
23 lines
446 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <deque>
|
|
using namespace std;
|
|
int main(){
|
|
deque<string> a;
|
|
a.push_back("First");
|
|
a.push_back("Second");
|
|
for(string x : a){
|
|
cout << x << " ";
|
|
}
|
|
cout << endl;
|
|
auto it = a.begin(); // auto = std::deque<string>::iterator
|
|
a.insert(it + 1, "Insert");
|
|
a.push_front("Naught");
|
|
a.push_back("Last");
|
|
for(it = a.begin(); it != a.end(); it++){
|
|
cout << *it << " ";
|
|
}
|
|
cout << endl;
|
|
return 0;
|
|
}
|