codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <vector> #include <list> #include <iterator> #include <algorithm> template <class T, template<class A, class Allocator = allocator<A> > class Container> void print(Container<T> cont) { std::copy(cont.begin(), cont.end(), std::ostream_iterator<T>(std::cout, " ")); } int main() { std::vector<int> vec; std::list<int> lis; vec.push_back(0);vec.push_back(3);vec.push_back(1);vec.push_back(6); lis.push_back(1);lis.push_back(2);lis.push_back(3);lis.push_back(4); print(vec); std::cout << endl; print(lis); return 0; }
Private
[
?
]
Run code
Submit