循环需要自己维护一个递归栈才有和递归相同的表达能力 递归 private String getAllPath(xx){ ..... xx=getAllPath(xx); ...... } 循环: 反正我写不出来