看到有好多人都在纠结输入,我就贴一下输入的代码吧。。。

    public static void main(String[] args) throws IOException {
        System.setIn(new BufferedInputStream(new FileInputStream("resource/huawei0001.txt")));
        Scanner sc = new Scanner(System.in);
        ArrayList<Boolean> list = new ArrayList<>();
        while (sc.hasNext()) {
            String[] temp = sc.nextLine().split(" ");
            int[] arr = new int[temp.length];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = Integer.parseInt(temp[i]);
            }
            list.add(checkOne(arr) || checkTwo(arr));
        }
        for (int i = 0; i < list.size() - 1; i++) {
            System.out.print(list.get(i) + " ");
        }
        System.out.print(list.get(list.size() - 1));
    }