• [I] Shameimaru's Candid Camera

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Shameimaru Aya(しゃめいまる·あや) likes to photograph others secretly. So she plans to set some photo point in the map.
    Once she has set all the photo point, she have to sign out it.
    Every coordinate of the map have to sign out the number of photo point nearby. The word "nearby" means the 9-cell matrix with the point in the center.
    You can see the image below:

    (The left top point is (0, 0)).

    Your task is to help Shameimaru to sign out every cell in the map. (Except the photo point)

  • 输入
  • This problem has several cases. The first line of each case contains two integers: N, M(0 < N, M <= 500), Means the width and the height of the map.
    Then follows a map larges (N, M). '-' indicates a space and '*' means a photo point.
  • 输出
  • For each case, output the map after signing. Leave a single line between each case.
  • 样例输入
  • 6 6
    -*----
    ------
    ------
    --*---
    ------
    -*----
    
  • 样例输出
  • 1*1---
    111---
    -111--
    -1*1--
    1221--
    1*1---
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜