Suppose having three arrays:
char [] one = {'a','b','c'};
char [] two = {'1','2','3'};
char [] three = {'x','y','z'};
If I want to print them like this:
a 1 x
a 1 y
a 1 z
a 2 x
a 2 y
.....
c 3 z
I must create three nested loops;
for(char i : one)
for(char j : two)
for(char k : three)
//.....
Suppose if I have 7 arrays, it will be 7 nested loops.
Is there a better way to do that or an API maybe? I know you're probably asking why you do such a thing, It's just the mater of thinking.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…