Counting Cells in Blob(Blob 셀 수 세기)
재귀를 이용하여 구현하였다. public class Main { //이차원 배열로 이미지 표현 static int arr[][] ={ {1,0,0,0,0,0,0,1}, {0,1,1,0,0,1,0,0}, {1,1,0,0,1,0,1,0}, {0,0,0,0,0,1,0,0}, {0,1,0,1,0,1,0,0}, {0,1,0,1,0,1,0,0}, {1,0,0,0,1,0,0,1}, {0,1,1,0,0,1,1,1}}; //상수로 컬러 표현 public static final int BackgroundColor = 0; public static final int ImageColor = 1; public static final int AlreadyCounted = 2; public static void main(Strin..
2022. 10. 12.