2 shunfurh shunfurh 于 2017.09.10 13:47 提问

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.

A box fractal is defined as below :

A box fractal of degree 1 is simply
X
A box fractal of degree 2 is
X X
X
X X
If using B(n - 1) to represent the box fractal of degree n - 1, then a box fractal of degree n is defined recursively as following
B(n - 1) B(n - 1)
B(n - 1)
B(n - 1) B(n - 1)
Your task is to draw a box fractal of degree n.

Input

The input consists of several test cases. Each line of the input contains a positive integer n which is no greater than 7. The last line of input is a negative integer -1 indicating the end of input.

Output

For each test case, output the box fractal using the 'X' notation. Please notice that 'X' is an uppercase letter. Print a line with only a single dash after each test case. Don't output any trailing spaces at the end of each line, or you may get an 'Presentation Error'!

Sample Input

1
2
3
4
-1

Sample Output

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 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

1个回答

devmiao
devmiao   Ds   Rxr 2017.09.27 21:52
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
[转]Ultra Fractal 5.04 破解版汉化包
使用方法:将汉化文件放置到Uf5.exe相同目录下再运行Ultra Fractal 说明:汉化达到95%,有一些地方进行汉化了,但是使用些汉化包依旧是英文显示,不过那些个别的。同样的还有个别单词翻译不好,没有进行汉化依旧英文显示。 由于英文水平有限,如果有些地方汉化翻译不到位
tokudb  fractal tree (分型树)
淘宝月报 http://mysql.taobao.org/monthly/2016/04/
FerryMan Fractal 1.8
FerryMan Fractal (FMF) 是全球唯一一款支持图层组的分形软件,也是难得的中国国产分形软件。它非常小(1.43M)却非常强大、灵活的交互式超级矢量设计工具。它的通用性来自它灵活漂亮的底层架构,可以为数学绘画提供基础平台。设计师可以用这个软件设计复数分形,也可以使用它的扩展组件设计三维场景或者导入照片。这一切都来自FMF所特有的Fibrics技术,使得一切和数字艺术相关的东西都有可能集成在一起。
POJ 1941 The Sierpinski Fractal
模拟(递归)
[poj3889]Fractal Streets
转载请说明出处:http://blog.csdn.net/ben_xsy/article/details/79288058#%E4%BB%A3%E7%A0%81 目录 题目描述 解题思路 代码 题目描述 题目链接:传送门 给你一个原始的分形图,t组数据,对于每组数据,输入3个数n,h,o (n为在第n级,h,o为两个房子的编号) 求在第n级情况下,编号为h和o的两个点之间的...
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
FractalFox
FractalFox图片分形软件 BIP:BIP-001 FractalFox:FD1-EVAL-WI38X-POYHM-QXCFR
Fractal
Description 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
[转]TokuDB中的COLA-Tree和TokuMax中的Fractal tree(分形树)
TokuDB中的COLA-Tree
poj 1941 The Sierpinski Fractal(递归)
poj 1941:The Sierpinski Fractal