编写一个使用大于1或小于-1的整数的程序或函数。也就是说,输入将不是0、1或-1。
如果输入为2
,则输出应为:
|\_/|
|___|
如果输入为3
,则输出应为:
|\_/\_/|
|______|
如果输入为4
,则输出应为:
|\_/\_/\_/|
|_________|
对于较大的输入,该模式以相同的精确方式继续。例如,如果输入为10
,则输出应为:
|\_/\_/\_/\_/\_/\_/\_/\_/\_/|
|___________________________|
如果输入为-2
,则输出应为:
____
| |
|_/\_|
如果输入为-3
,则输出应为:
_______
| |
|_/\_/\_|
如果输入为-4
,则输出应为:
__________
| |
|_/\_/\_/\_|
对于较小的输入,该模式以相同的精确方式继续。例如,如果输入为-10
,则输出应为:
____________________________
| |
|_/\_/\_/\_/\_/\_/\_/\_/\_/\_|
输出可以打印或作为字符串返回,并带有可选的尾随换行符。负输入的输出的右上角“空”角可能是空格,也可能保持为空。
以字节为单位的最短代码获胜。