编程介的小学生 2017-12-05 08:08 采纳率: 20.5%
浏览 901
已采纳

Bold ASCII Lines

Problem Description
Your grandmother recently developed a passion for the internet and the new technologies in general, and is now discovering the wonders of ASCII art. Unfortunately, her sight is not as it once was, and she has difficulty seeing the pictures.

Moreover, she cannot merely increase the font size as she usually does, because doing so makes the characters stand out more on their own and less as a whole. You come up with a solution: writing a program which duplicates the ASCII lines in order to make them look bold.

Input
The first line of the input will contain n, the number of test cases. For each test case, the first line will contain the positive integers w and h, both of which will be at most 100. h lines will follow, each containing w ASCII characters.

The character “.” (dot) will denote the background ASCII “color”, and the only other color will be “*” (star). For each image, add a 1-character wide border of dots around the image, and proceed to replace every single star character in the original picture with a , where the middle star is positioned where the original star was.

Output
In the output, separate each test case with “---”.

Sample Input
2
2 1
.
3 3
.
.
.
.*.

Sample Output
.*..
***.

.*..

..*..
.***.


.***.
..*..

  • 写回答

2条回答

  • threenewbee 2017-12-10 16:17
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 C#调用python代码(python带有库)
  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B