复习一下DFS实现全排列,具体思想见:https://www.cnblogs.com/chiweiming/p/9279858.html public class Main{ static int arr[]=new int[6]; static int book[]=new int[6]; static int result=0; static void fun(int N){ if(N==6){ result++; for(int i=1;i<=5;i++){ System.out.prin…