钢琴键的宽度为3个字符,高度为7个字符。但是,如果每个键都为3个字符宽,则黑色键的空间将不足。这就是为什么某些白色键的某些部分被切掉的原因。白键有3种类型。
缺少右半(R)的键:
____
| |
| |
| |
| |
| |
| |
|___|
左半边缺少的键(L):
____
| |
| |
| |
| |
| |
| |
|___|
以及缺少左右两半的键(M):
___
| |
| |
| |
| |
| |
| |
|___|
在真正的键盘上,这些模式如下所示:
RMLRMML, RMLRMML, RMLRMML...
并重复总共88个按键。现在,当各个按键分别显示时,您将看不到它,但是将它们推在一起时,您可以看到黑色按键。
_________________________________________________________
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
你的任务
给定正整数N,用N个白键打印钢琴的ASCII码。您应该能够处理从1到52(含)之间的任何N(因为实际的88键钢琴具有52个白键)。这是从1到8的测试输出,然后模式以类似的方式增加。
1
____
| |
| |
| |
| |
| |
| |
|___|
2
________
| | | |
| | | |
| | | |
| | | |
| | |
| | |
|___|___|
3
_____________
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | |
| | | |
|___|___|___|
4
________________
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | |
| | | | |
|___|___|___|___|
5
____________________
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | |
| | | | | |
|___|___|___|___|___|
6
________________________
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | |
| | | | | | |
|___|___|___|___|___|___|
7
_____________________________
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | |
| | | | | | | |
|___|___|___|___|___|___|___|
8
________________________________
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
|___|___|___|___|___|___|___|___|
最后但并非最不重要的是,这是完整的52键输出:
_________________________________________________________________________________________________________________________________________________________________________________________________________________
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
禁止使用标准漏洞,以字节为单位的最短答案将获胜!