Skip to content

Instantly share code, notes, and snippets.

@krysseltillada
Created July 21, 2015 14:37
Show Gist options
  • Save krysseltillada/f8f90c5344cfa02bc495 to your computer and use it in GitHub Desktop.
Save krysseltillada/f8f90c5344cfa02bc495 to your computer and use it in GitHub Desktop.
std::list whose elements are std::deque that are integer
#include <iostream>
#include <list>
#include <deque>
int main ()
{
std::list <std::deque <int> > list_deq;
std::deque <int> temp_deq, temp_deq2;
int temp_int = 0;
while (std::cin >> temp_int) {
temp_deq.push_front (temp_int);
std::cin >> temp_int;
temp_deq2.push_back (temp_int);
}
list_deq.push_front (temp_deq);
list_deq.push_front (temp_deq2);
for (auto ld : list_deq) {
for (auto d : ld) {
std::cout << d << " ";
}
std::cout << " , ";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment