33 lines
476 B
C++
33 lines
476 B
C++
![]() |
#include "deque.h"
|
||
|
|
||
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
Deque<int> a;
|
||
|
|
||
|
a.push_back(243);
|
||
|
a.push_back(34);
|
||
|
a.push_back(45);
|
||
|
a.push_back(456);
|
||
|
a.push_front(3240);
|
||
|
|
||
|
cout << endl;
|
||
|
cout << endl;
|
||
|
for (int i = 0; i < a.size(); ++i) {
|
||
|
cout << a[i] << " ";
|
||
|
}
|
||
|
cout << endl << endl;
|
||
|
|
||
|
auto it = a.begin();
|
||
|
it += 3;
|
||
|
|
||
|
a.erase(a.end());
|
||
|
|
||
|
cout << endl;
|
||
|
cout << endl;
|
||
|
for (int i = 0; i < a.size(); ++i) {
|
||
|
cout << a[i] << " ";
|
||
|
}
|
||
|
}
|