<!--StartFragment-->

입력 예

<!--[if !supportEmptyParas]--> <!--[endif]-->

출력 예

4

<!--[if !supportEmptyParas]--> <!--[endif]-->

4

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

Field #1:

*

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

*

1

0

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

.

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

2

2

1

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

.

*

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

1

*

1

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

.

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

1

1

1

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

3

<!--[if !supportEmptyParas]--> <!--[endif]-->

5

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

*

*

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

Field #2:

.

.

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

*

*

1

1

0

.

*

.

.

.

<!--[if !supportEmptyParas]--> <!--[endif]-->

3

3

2

0

0

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

0

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

1

*

1

0

0

 

import java.util.Scanner;

public class SearchBoom {
 public static void main(String[] args)
 {
  
  final int MAX_N = 100;
  final int MAX_M = 100;
  int n,m;
  int i,j,i2,j2;
  int field_id=1;
  
  int [] row = new int[MAX_M + 1];
  int [][] mf = new int[MAX_N + 2][MAX_M + 2];
  
  System.out.println("행 열 입력 :");
  Scanner input = new Scanner(System.in);
  n= input.nextInt();
  m= input.nextInt();
  
  while(n||m)
  {
   for(i=1; i<=n; i++) // initialize
    for(j=1; j<=m; j++)
     mf[i][j] = '0';

   for(i=1; i<=n; i++)
   {
   
    for(j=1; j<=m; j++)
     if(row[j-1] == '*')
     {
      for(i2 = i-1; i2 <= i+1; i2++)
       for(j2 = j-1; j2 <= j+1; j2++)
        if(mf[i2][j2] != '*')
         mf[i2][j2]++;
      mf[i][j] = '*';
     }
   }
   //n=m=0;
   if(field_id > 1)
    putchar(' ');
   System.out.printf("Field #%d: ", field_id++);

   for(i=1; i <= n; i++)
   {
    for(j=1; j <= m; j++) {
     putchar(mf[i][j]);
     putchar('.');
    }
    putchar(' ');
   }
  }

 }

 private static void putchar(int mf) {
  
 }
}

 

고칠것좀 ㅠㅜ 이상하게나옴