How to list all of variations without STL C++
<p>I have got stuck.</p>

<p>Could anyone help me?
My problem is that I have no idea, how to make listing variations without STL.</p>

<p>Example:</p>

<pre><code> Input : a[3] = {1, 2, 3}
 n = 2
</code></pre>

<p>Output:
                        1 1;    2 1;    3 1;
            1 2;    2 2;    3 2;
            1 3;    2 3;    3 3;</p>

<p>I can't use loops, because the input can be as big as I declare, and n is a variable too.</p>

<p>Thanks :)</p>
