Print to video permutations You want to print vectors with n elements, where:


the first element can have the values: e1.1, e1.2, e1.2;
the second element can assume the values: e2.1, e2.2, e2.3;
...;
...;
the nth element can assume the values: en.1, en.2, en.3.


I should print all possible vectors; eg:

{e1.1, e2.1, en.1 ...};

{e1.2, e2.1, en.1 ...};

etc. etc.

Someone could indicate an algorithm making use of while/for loop to print these vectors?

Thanks so much!
The idea is to think of your output as representing a number in a mixed base. The $i$th digit has base $b_i$, where $b_i$ is the number of options for the $i$th element. You can then print all possible vectors essentially by implementing a counter. I'll let you work out the details.