Yurttas/PL/OOL/Cplusplus/F/07/01/03/00/dq 00.cpp

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for I_ADUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : January 1, 1998.
11   author : Salih Yurttas.
12
13   dq_00.cpp
14*/
15
16
17#include <iostream>
18
19#include <deque>
20
21using namespace std;
22
23int main(int argc, char* argv[]) {
24
25  deque<int> dq;
26
27  dq.push_back(2);
28  dq.push_back(1);
29  dq.push_back(9);
30  dq.push_back(7);
31
32  deque<int> q_1(dq);
33  
34  while(!dq.empty()) {
35    cout << dq.front() << endl;
36    dq.pop_front();
37  }
38
39  cout << endl;
40
41  while(!q_1.empty()) {
42    cout << q_1.back() << endl;
43    q_1.pop_back();
44  }
45
46}