fork(7) download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <iterator>
  4. #include <vector>
  5.  
  6. template<typename T>
  7. std::ostream & operator<<(std::ostream & os, std::vector<T> vec)
  8. {
  9. os<<"{ ";
  10. std::copy(vec.begin(), vec.end(), std::ostream_iterator<T>(os, " "));
  11. os<<"}";
  12. return os;
  13. }
  14.  
  15. int main()
  16. {
  17. std::vector<int> v1(6, 1);
  18. std::vector<int> v2(4, 0);
  19. std::cout<<v1<<"\n"<<v2<<"\n";
  20. return 0;
  21. }
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
{ 1 1 1 1 1 1 }
{ 0 0 0 0 }