这是一块蛋糕:
_========_
| |
+________+
| |
+________+
| |
+________+
它是8宽,3高和1深。
您必须编写一个程序,通过3个输入来制作蛋糕。第一个输入控制中间有多少个下划线=
,顶部是s。这是第一个宽度为10而不是8的蛋糕:
_==========_
| |
+__________+
| |
+__________+
| |
+__________+
第二个输入控制蛋糕的高度。这是第二个蛋糕,高度为4而不是3:
_==========_
| |
+__________+
| |
+__________+
| |
+__________+
| |
+__________+
注意各层的重复。
第三个输入控制它的深度。那就是| |
要包含在顶部的个数。这是深度为2而不是1的第三个蛋糕
_==========_
| |
| |
+__________+
| |
+__________+
| |
+__________+
| |
+__________+
您可以打印尾随空格。测试用例:
输入:3
,3
,3
输出:
_===_
| |
| |
| |
+___+
| |
+___+
| |
+___+
(我希望我永远不会得到这个蛋糕)
输入:3
,2
,1
输出:
_===_
| |
+___+
| |
+___+
输入:5
,5
,5
输出:
_=====_
| |
| |
| |
| |
| |
+_____+
| |
+_____+
| |
+_____+
| |
+_____+
| |
+_____+
输入将始终为正整数吗?
—
尼克·克利福德
是否允许尾随换行符?
—
毛茸茸的
@Shaggy我以为是这样,默认情况下在Meta上是。
—
程序员