title: Create all possible combinations of multiple vectors
body: <p>I would like to create the combinations of several vectors </p>
  
  <pre><code>vector&lt;int&gt; Vec1;
  Vec1.push_back(1);
  Vec1.push_back(2);
  Vec1.push_back(3);
  
  vector &lt;int&gt; Vec2;
  Vec2.push_back(5);
  Vec2.push_back(6);
  Vec2.push_back(7);
  Vec2.push_back(8);
  
  vector &lt;int&gt; Vec3;
  Vec3.push_back(11);
  Vec3.push_back(12);
  Vec3.push_back(13);
  
  vector&lt;vector&lt;int&gt;&gt; xt;
  xt.push_back(Vec1);
  xt.push_back(Vec2);
  xt.push_back(Vec3);
  </code></pre>
  
  <p>The results should be something like</p>
  
  <p>1 5 11<br>
  1 5 12<br>
  ...<br>
  3 8 13   </p>
  
  <p>I could use nest loop for a given number of vectors. However, I am trying to write a function, like 
  void printAll(const vector > &amp;xt)
  I did find something similar </p>
  
  <p><a href="https://stackoverflow.com/questions/1700079/howto-create-combinations-of-several-vectors-without-hardcoding-loops-in-c">Howto create combinations of several vectors without hardcoding loops in C++?</a></p>
  
  <p>But I am struggling converting it into int. Please offer me some suggestions.  </p>