Language: Java

int field[][] = setField();
		System.out.println("入力してください");
		Scanner input = new Scanner(System.in);
		while (input.hasNext()) {
			String[] inputString = input.next().split(",");
			drop(field, Integer.parseInt(inputString[0]),
					Integer.parseInt(inputString[1]),
					Integer.parseInt(inputString[2]) );
		}
		amountOfWhite(field);
		maxDepth(field);

	}

	private static int[][] setField() {
		int field[][] = new int[10][10];
		for (int i = 0; i < 9; i++) {
			for (int j = 0; j < 9; j++) {
				field[i][j] = 0;
			}
		}
		return field;
	}

	private static void drop(int[][] field, int x, int y, int size) {
		switch (size) {
		case 1:
			dropSmall(field, x, y);
			break;

		case 2:
			dropMiddle(field, x, y);
			break;
		case 3:
			dropLarge(field, x, y);
			break;
		}

	}

	private static void dropLarge(int[][] field, int x, int y) {

		dropMiddle(field, x, y);

		int dropX[] = { -2, 0, 2, 0 };
		int dropY[] = { 0, -2, 0, 2 };

		for (int i = 0; i < dropX.length; i++) {
			x += dropX[i];
			y += dropY[i];
			dropping(field, x, y);
		}
	}

	private static void dropMiddle(int[][] field, int x, int y) {

		dropSmall(field, x, y);

		int dropX[] = { -1, -1, 1, 1 };
		int dropY[] = { 1, -1, 1, -1 };

		for (int i = 0; i < dropX.length; i++) {
			x += dropX[i];
			y += dropY[i];
			dropping(field, x, y);
		}
	}

	private static void dropSmall(int[][] field, int x, int y) {
		int dropX[] = { -1, 0, 1, 0 };
		int dropY[] = { 0, -1, 0, 1 };
		dropping(field, x, y);

		for (int i = 0; i < dropX.length; i++) {
			x += dropX[i];
			y += dropY[i];
			dropping(field, x, y);
		}
	}

	private static int[][] dropping(int[][] field, int x, int y) {
		if (0 < x || x < 10 || 0 < y || y < 10) {
			field[x][y] += 1;
		}
		return field;
	}

	private static void amountOfWhite(int[][] field){
		int count = 0;
		for (int i = 0; i < 9; i++) {
			for ( int j = 0; j < 9; j++) {
				if(field[i][j] == 0){
					count++;
				}
			}
		}
		System.out.println(count);
	}

	private static void maxDepth(int[][] field){
		int maxDepth = 0;
		for (int i = 0; i < 9; i++) {
			for ( int j = 0; j < 9; j++) {
				if(maxDepth < field[i][j]){
					maxDepth = field[i][j];
				}
			}
		}
		System.out.println(maxDepth);
	}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
int field[][] = setField();
^
Main.java:2: error: class, interface, enum, or record expected
		System.out.println("????????");
		^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
		Scanner input = new Scanner(System.in);
		^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: class, interface, enum, or record expected
		while (input.hasNext()) {
		^
Main.java:6: error: class, interface, enum, or record expected
			drop(field, Integer.parseInt(inputString[0]),
			^
Main.java:9: error: class, interface, enum, or record expected
		}
		^
Main.java:11: error: class, interface, enum, or record expected
		maxDepth(field);
		^
Main.java:13: error: class, interface, enum, or record expected
	}
	^
Main.java:17: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		^
Main.java:17: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                ^
Main.java:17: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                       ^
Main.java:18: error: class, interface, enum, or record expected
			for (int j = 0; j < 9; j++) {
			                ^
Main.java:18: error: class, interface, enum, or record expected
			for (int j = 0; j < 9; j++) {
			                       ^
Main.java:20: error: class, interface, enum, or record expected
			}
			^
Main.java:23: error: class, interface, enum, or record expected
	}
	^
Main.java:29: error: class, interface, enum, or record expected
			break;
			^
Main.java:31: error: class, interface, enum, or record expected
		case 2:
		^
Main.java:33: error: class, interface, enum, or record expected
			break;
			^
Main.java:34: error: class, interface, enum, or record expected
		case 3:
		^
Main.java:36: error: class, interface, enum, or record expected
			break;
			^
Main.java:37: error: class, interface, enum, or record expected
		}
		^
Main.java:45: error: class, interface, enum, or record expected
		int dropX[] = { -2, 0, 2, 0 };
		^
Main.java:46: error: class, interface, enum, or record expected
		int dropY[] = { 0, -2, 0, 2 };
		^
Main.java:48: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		^
Main.java:48: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                ^
Main.java:48: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                                  ^
Main.java:50: error: class, interface, enum, or record expected
			y += dropY[i];
			^
Main.java:51: error: class, interface, enum, or record expected
			dropping(field, x, y);
			^
Main.java:52: error: class, interface, enum, or record expected
		}
		^
Main.java:59: error: class, interface, enum, or record expected
		int dropX[] = { -1, -1, 1, 1 };
		^
Main.java:60: error: class, interface, enum, or record expected
		int dropY[] = { 1, -1, 1, -1 };
		^
Main.java:62: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		^
Main.java:62: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                ^
Main.java:62: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                                  ^
Main.java:64: error: class, interface, enum, or record expected
			y += dropY[i];
			^
Main.java:65: error: class, interface, enum, or record expected
			dropping(field, x, y);
			^
Main.java:66: error: class, interface, enum, or record expected
		}
		^
Main.java:71: error: class, interface, enum, or record expected
		int dropY[] = { 0, -1, 0, 1 };
		^
Main.java:72: error: class, interface, enum, or record expected
		dropping(field, x, y);
		^
Main.java:74: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		^
Main.java:74: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                ^
Main.java:74: error: class, interface, enum, or record expected
		for (int i = 0; i < dropX.length; i++) {
		                                  ^
Main.java:76: error: class, interface, enum, or record expected
			y += dropY[i];
			^
Main.java:77: error: class, interface, enum, or record expected
			dropping(field, x, y);
			^
Main.java:78: error: class, interface, enum, or record expected
		}
		^
Main.java:84: error: class, interface, enum, or record expected
		}
		^
Main.java:86: error: class, interface, enum, or record expected
	}
	^
Main.java:90: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		^
Main.java:90: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                ^
Main.java:90: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                       ^
Main.java:91: error: class, interface, enum, or record expected
			for ( int j = 0; j < 9; j++) {
			                 ^
Main.java:91: error: class, interface, enum, or record expected
			for ( int j = 0; j < 9; j++) {
			                        ^
Main.java:94: error: class, interface, enum, or record expected
				}
				^
Main.java:98: error: class, interface, enum, or record expected
	}
	^
Main.java:102: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		^
Main.java:102: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                ^
Main.java:102: error: class, interface, enum, or record expected
		for (int i = 0; i < 9; i++) {
		                       ^
Main.java:103: error: class, interface, enum, or record expected
			for ( int j = 0; j < 9; j++) {
			                 ^
Main.java:103: error: class, interface, enum, or record expected
			for ( int j = 0; j < 9; j++) {
			                        ^
Main.java:106: error: class, interface, enum, or record expected
				}
				^
Main.java:110: error: class, interface, enum, or record expected
	}
	^
61 errors