编程介的小学生 2017-04-02 03:08 采纳率: 20.5%
浏览 757
已采纳

Fractal

A fractal is an object or quantity that displays self-similarity, in a somewhat technical sense, on all scales. The object need not exhibit exactly the same structure at all scales, but the same "type" of structures must appear on all scales. Given an m * n bitmap bmp, your job is to draw a "k-F bitmap of bmp". A "k-F bitmap of bmp" is made up of m * n sub-bitmap with blank bit in bmp replaced by blank region and no blank bit int bmp replaced by "(k-1)-F bitmap of bmp", and "1-F bitmap of bmp" is bmp itself. More details in sample.

Input

There will be multiple cases. Process to the End Of File.

Each case bigin with two positive integer m and n both less than 12, then a m * n bitmap bmp with trailing blanks if necessary. At last, a positive integer k no more than 12 indicate the desired bitmap.

Ouput

First ouput "Fractal #%d:" in a line where "%d" is the case id, ans output the answer to this case. Seperate cases with a blank line. No trailing blanks are allowed in the output.

Sample Input

1 3

4
3 3
X X
X
X X
3
6 6
+----+
| /\ |
|/ |
| /\ |
| \/ |
+----+
2
Sample Output

Fractal #1:

## ## ## ## ## ##

Fractal #2:
X X X X X X X X
X X X X
X X X X X X X X
X X X X
X X
X X X X
X X X X X X X X
X X X X
X X X X X X X X
X X X X
X X
X X X X
X X
X
X X
X X X X
X X
X X X X
X X X X X X X X
X X X X
X X X X X X X X
X X X X
X X
X X X X
X X X X X X X X
X X X X
X X X X X X X X

Fractal #3:
+----++----++----++----++----++----+
| /\ || /\ || /\ || /\ || /\ || /\ |
|/ ||/ ||/ ||/ ||/ ||/ |
| /\ || /\ || /\ || /\ || /\ || /\ |
| \/ || \/ || \/ || \/ || \/ || \/ |
+----++----++----++----++----++----+
+----+ +----++----+ +----+
| /\ | | /\ || /\ | | /\ |
|/ | |/ ||/ | |/ |
| /\ | | /\ || /\ | | /\ |
| \/ | | \/ || \/ | | \/ |
+----+ +----++----+ +----+
+----++----+ +----++----+
| /\ || /\ | | /\ || /\ |
|/ ||/ | |/ ||/ |
| /\ || /\ | | /\ || /\ |
| \/ || \/ | | \/ || \/ |
+----++----+ +----++----+
+----+ +----++----+ +----+
| /\ | | /\ || /\ | | /\ |
|/ | |/ ||/ | |/ |
| /\ | | /\ || /\ | | /\ |
| \/ | | \/ || \/ | | \/ |
+----+ +----++----+ +----+
+----+ +----++----+ +----+
| /\ | | /\ || /\ | | /\ |
|/ | |/ ||/ | |/ |
| /\ | | /\ || /\ | | /\ |
| \/ | | \/ || \/ | | \/ |
+----+ +----++----+ +----+
+----++----++----++----++----++----+
| /\ || /\ || /\ || /\ || /\ || /\ |
|/ ||/ ||/ ||/ ||/ ||/ |
| /\ || /\ || /\ || /\ || /\ || /\ |
| \/ || \/ || \/ || \/ || \/ || \/ |
+----++----++----++----++----++----+

  • 写回答

1条回答

  • threenewbee 2017-04-12 15:35
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!