这个题目的解决方案我采用的是dfs加上回溯的方法 import java.util.Scanner; public class Main { private static int maxLen = 0; private static int[][] steps = {{1,0},{-1,0},{0,1},{0,-1}}; private static boolean[][] arr; private static int num = 0; public static void main(String[] args) { Scanner ...