fork download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. template <typename iter>
  5. void print_sequence(iter beg, iter end)
  6. {
  7. std::cout << "{ ";
  8.  
  9. while (beg != end)
  10. std::cout << *beg++ << ' ' ;
  11.  
  12. std::cout << "}\n";
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18. std::vector<int> data =
  19. {
  20. 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,
  21. 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0,
  22. 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0,
  23. 0, 0, 0
  24. };
  25. print_sequence(data.begin(), data.end());
  26.  
  27. data = { 2, 3, -1, 1, 2, 3, -1, 1, 2, 5, -1, 5, -1, 2, 3, 4, -2 };
  28. print_sequence(data.begin(), data.end());
  29. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
{ 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 }
{ 2 3 -1 1 2 3 -1 1 2 5 -1 5 -1 2 3 4 -2 }