fork(1) download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. int main() {
  5. std::vector<int> a = {1, 2, 3};
  6. std::vector<std::string> b = {"hello", "world", "foo", "bar"};
  7. std::vector<int> c = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  8.  
  9. auto ia = a.begin();
  10. auto ib = b.begin();
  11. auto ic = c.begin();
  12.  
  13. while (ia != a.end() && (ib != b.end()) && (ic != c.end())) {
  14. std::cout << *ia++ << ", ";
  15. std::cout << *ib++ << ", ";
  16. std::cout << *ic++ << std::endl;
  17. };
  18. }
Success #stdin #stdout 0s 4524KB
stdin
Standard input is empty
stdout
1, hello, 9
2, world, 8
3, foo, 7