利用递归来模拟多重嵌套循环
如以下循环:
1 2 3 4 5 6 |
|
对应递归:
public static void demo(){
int[] counts = new int[3];
counts[0] = 1;
counts[1] = 2;
counts[2] = 3;
for(int i=0;i<counts[0];i++)
for(int j=0;j<counts[1];j&#
利用递归来模拟多重嵌套循环
如以下循环:
1 2 3 4 5 6 |
|
对应递归:
public static void demo(){
int[] counts = new int[3];
counts[0] = 1;
counts[1] = 2;
counts[2] = 3;
for(int i=0;i<counts[0];i++)
for(int j=0;j<counts[1];j&#