public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); findLengthOfHuiWenZiChuan(s, 4); } public static void huoGuo(String[] args) { //火锅 int[][] arr = new int[][]{{1, 2}, {2, 1}}; answer(arr, 1); } public static void answer(int[][] arr, int m){ //定义一个数组, int[] timeAndReady = new int[arr.length]; for (int i = 0; i < arr.length; i++) { timeAndReady[i] = arr[i][0] + arr[i][1]; } Arrays.sort(timeAndReady); int count = 0; int timeCount = 0; for (int i = 0; i < arr.length; i++) { if (m <= timeAndReady[i] - timeCount){ count++; timeCount = timeAndReady[i]; } } System.out.println(count); }