package com.test;
import java.util.*;
public class sample13 {
public static void main(String[] args) {
final int SIZE = 10;
int x=0 , y=0;
char[][] board = new char [SIZE][SIZE];
byte[][] shipboard = {
{0, 0, 0, 0, 0, 0, 1, 0, 0},
{1, 1, 1, 1, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 1, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0}
};
// 1행에 행번호를, 1열에 열번호를 저장한다.
for (int i=1; i<SIZE; i++)
board[0][i] = board[i][0] = (char) (i+'0');
Scanner scanner = new Scanner(System.in);
while(true) {
System.out.printf("좌표를 입력하세요. (종료는 00)");
String input = scanner.nextLine();
if(input.length() == 2) {
x=input.charAt(0) - '0';
y=input.charAt(1) - '0';
if(x==0 && y==0) // x와 y 모두 0인경우 종료
break;
}
if(input.length() !=2 || x<=0 || x>=SIZE || y<=0 || y>=SIZE) {
System.out.println("잘못된 입력입니다. 다시 입력해주세요.");
continue;
}
board[x][y] = shipboard[x-1][y-1]==1 ? 'o' : 'x' ;
for (int i=0; i<SIZE; i++)
System.out.println(board[i]);
System.out.println();
}
}
}






x=input.charAt(0) - '0';



y=input.charAt(1) - '0';



여기에서 - '0';가 뭔 뜻이야?