给定一个字符,输出(到屏幕)字符后面的整个qwerty键盘布局(带有空格和换行符)。这些例子说明了这一点。
输入1
f产出1
g h j k l
z x c v b n m投入2
q产出2
w e r t y u i o p
a s d f g h j k l
z x c v b n m投入3
m产出3
(程序终止时没有输出)
投入4
l产出4
z x c v b n m最短代码获胜。(单位:字节)
附注:
接受额外的换行符或行尾的额外空格。
发布于 2015-11-24 17:58:02
jjL\ cec."`zÈ´ýß44,ûtKÕÀ@"z\`注意,有些字符是不可打印的。在Pyth编译器网上试一试。
jjL\ cec."`z…"z\`
."`z…" Unpack …, with lowest character '`' and highest character `z`.
c z Split at occurrences of the input (z).
e Retrieve the last resulting chunk.
c \` Split into rows, at backticks.
jL\ Separate the characters of each row by spaces.
j Separate the rows by linefeeds.发布于 2015-11-24 21:17:03
x=>[...`qwertyuiop
asdfghjkl
zxcvbnm`].join` `.split(x)[1]使用与大多数其他答案相同的技术。欢迎提出建议!
发布于 2015-11-24 11:19:03
lambda c,s="q w e r t y u i o p\na s d f g h j k l\nz x c v b n m":s[s.index(c)+2:]在网上试试
https://codegolf.stackexchange.com/questions/64639
复制相似问题