题解 | #二维数组操作#
二维数组操作
https://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4
import java.util.*; public class Main { public static void main(String[] args) { Scanner fzhinput = new Scanner(System.in); while (fzhinput.hasNextLine()) { int h = fzhinput.nextInt(); int l = fzhinput.nextInt(); int bg[][]; if (h <= 9 && l <= 9) { bg = new int[h][l]; System.out.println(0); } else { System.out.println(-1); } int x1 = fzhinput.nextInt(); int y1 = fzhinput.nextInt(); int x2 = fzhinput.nextInt(); int y2 = fzhinput.nextInt(); if (x1 < h && y1 < l && x2 < h && y2 < l) { System.out.println(0); } else { System.out.println(-1); } int h1 = fzhinput.nextInt(); if (h + 1 <= 9&&h1<h) { System.out.println(0); } else { System.out.println(-1); } int l1 = fzhinput.nextInt(); if (l + 1 <= 9&&l1<l) { System.out.println(0); } else { System.out.println(-1); } int x3 = fzhinput.nextInt(); int y3 = fzhinput.nextInt(); if (x3 < h && y3 < l) { System.out.println(0); } else { System.out.println(-1); } fzhinput.nextLine(); } } }