26

挑战

从给定的数字卡列表中输出最佳情况二十一点手的按字符计数的最短代码。

输入是从 1 到 10(含)的数字列表,由空格分隔。

输出将是从该卡片列表中形成的最佳二十一点手 - 最接近的可用组合,通过所有卡片值的总和达到 21 而不超过它。卡片可以移除但不能添加。

如果需要移除两张或更多卡片以支持一张卡片以达到相同的结果(移除 5 或 4,1 以获得 21)需要移除最少的卡片。如果要移除相同数量的牌(移除 1,4 或 3,2),则将移除最小值中的最小值的组(在前面的示例中,将移除min(min(3,2), min(1,4))属于该对的 1,4)。在重复卡的情况下,应删除第一次遭遇。

输出将形成钻石卡,并保留输入顺序:

__________ __________
| || |
| || /\ |
| || \/ |
| /\ || |
| \/ || |
| || /\ |
| || \/ |
|__________||__________|
 __________ __________
| || |
| /\ || /\ /\ |
| \/ || \/ \/ |
| /\ || |
| \/ || |
| /\ || /\ /\ |
| \/ || \/ \/ |
|__________||__________|
 __________ __________
| || |
| /\ /\ || /\ /\ |
| \/ \/ || \/ \/ |
| /\ || /\ /\ |
| \/ || \/ \/ |
| /\ /\ || /\ /\ |
| \/ \/ || \/ \/ |
|__________||__________|
 __________ __________
| || |
| /\ /\ || /\ /\ |
| \/ /\ \/ || \/ /\ \/ |
| /\ \/ /\ || /\ \/ /\ |
| \/ \/ || \/ /\ \/ |
| /\ /\ || /\ \/ /\ |
| \/ \/ || \/ \/ |
|__________||__________|
 __________ __________
| /\ /\ || /\ /\ |
| \/ \/ || \/ /\ \/ |
| /\ /\ || /\ \/ /\ |
| \/ /\ \/ || \/ \/ |
| /\ \/ /\ || /\ /\ |
| \/ \/ || \/ /\ \/ |
| /\ /\ || /\ \/ /\ |
|_\/____\/_||_\/____\/_|

测试用例

Input:
    1 5 7 8
Output:
     __________  __________  __________  __________ 
    |          ||          ||          ||          |
    |          || /\    /\ || /\    /\ || /\    /\ |
    |          || \/    \/ || \/ /\ \/ || \/ /\ \/ |
    |    /\    ||    /\    || /\ \/ /\ || /\ \/ /\ |
    |    \/    ||    \/    || \/    \/ || \/ /\ \/ |
    |          || /\    /\ || /\    /\ || /\ \/ /\ |
    |          || \/    \/ || \/    \/ || \/    \/ |
    |__________||__________||__________||__________|

Input: 
    10 3 4 2 6
Output:
     __________  __________  __________  __________ 
    | /\    /\ ||          ||          ||          |
    | \/ /\ \/ || /\       || /\       || /\    /\ |
    | /\ \/ /\ || \/       || \/       || \/    \/ |
    | \/    \/ ||    /\    ||          || /\    /\ |
    | /\    /\ ||    \/    ||          || \/    \/ |
    | \/ /\ \/ ||       /\ ||       /\ || /\    /\ |
    | /\ \/ /\ ||       \/ ||       \/ || \/    \/ |
    |_\/____\/_||__________||__________||__________|

Input 
    5 10 5 2 3
Output:
     __________  __________  __________  __________ 
    | /\    /\ ||          ||          ||          |
    | \/ /\ \/ || /\    /\ || /\       || /\       |
    | /\ \/ /\ || \/    \/ || \/       || \/       |
    | \/    \/ ||    /\    ||          ||    /\    |
    | /\    /\ ||    \/    ||          ||    \/    |
    | \/ /\ \/ || /\    /\ ||       /\ ||       /\ |
    | /\ \/ /\ || \/    \/ ||       \/ ||       \/ |
    |_\/____\/_||__________||__________||__________|

代码计数包括输入/​​输出(即完整程序)。

4

9 回答 9

11

, 303个字符

4(1!:2)~,&(10{a.)"1>,.&.>/4 :'''/\/\''(x(<@:+)"1]4 2$1|.4#0 1)}y'&.>/@((<>1 7 1#1&|.@(2 10&#)&.>' _';'| ';'|_'),~>)"0(>({~[:(i.[:>./[*22&>)+/@>)(#:@i.@(2&^)@#<@#"1 _])".1!:1]3){a:,(((1$7);(a 0 _1;7),(a 0 2 _3 _1;7),((a=:,&.>/\)0 2 6 8 _3 _1;4;_5)){&.><,{(2+i.5);2 5 8),(4 5;k);<2 5;6 5;k=:,{2 8;~>:+:i.4
$回声-n 1 5 7 8 | jconsole test.js
 __________ __________ __________ __________
| || || || |
| || /\ /\ || /\ /\ || /\ /\ |
| || \/ \/ || \/ /\ \/ || \/ /\ \/ |
| /\ || /\ || /\ \/ /\ || /\ \/ /\ |
| \/ || \/ || \/ \/ || \/ /\ \/ |
| || /\ /\ || /\ /\ || /\ \/ /\ |
| || \/ \/ || \/ \/ || \/ \/ |
|__________||__________||__________||__________|

$回声-n 10 3 4 2 6 | jconsole test.js
 __________ __________ __________ __________
| /\ /\ || || || |
| \/ /\ \/ || /\ || /\ || /\ /\ |
| /\ \/ /\ || \/ || \/ || \/ \/ |
| \/ \/ || /\ || || /\ /\ |
| /\ /\ || \/ || || \/ \/ |
| \/ /\ \/ || /\ || /\ || /\ /\ |
| /\ \/ /\ || \/ || \/ || \/ \/ |
|_\/____\/_||__________||__________||______|

$回声-n 5 10 5 2 3 | jconsole test.js
 __________ __________ __________ __________
| /\ /\ || || || |
| \/ /\ \/ || /\ /\ || /\ || /\ |
| /\ \/ /\ || \/ \/ || \/ || \/ |
| \/ \/ || /\ || || /\ |
| /\ /\ || \/ || || \/ |
| \/ /\ \/ || /\ /\ || /\ || /\ |
| /\ \/ /\ || \/ \/ || \/ || \/ |
|_\/____\/_||__________||__________||______|

核心,找到最好的手,其实真的很容易。生成给定卡片的幂集,并选择最大值小于 22 的卡片。

({~[:(i.[:>./[*22&>)+/@>)(#:@i.@(2&^)@#<@#"1 _])

然后我们从一张空白卡开始

<>1 7 1#1&|.@(2 10&#)&.>' _';'| ';'|_'

并在适当的地方铺上钻石。

'/\/\'(x(<@:+)"1]4 2$1|.4#0 1)}y

程序的其余部分由钻石去哪里的表格主导。

于 2009-12-05T22:41:05.627 回答
9

Python - 365 个字符

h=map(int,raw_input().split());H=len(h);R=range
for r in R(9):x=["| "[1>r]];print"".join("_ "[0<r<8].join(x+["  \//\__"[ord(('?'*11+'@'*8+'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]]')[r*10+c])*2>>i&6:][:2]for i in 0,2,4]+x)for c in max([[h[b]for b in R(H)if n&1<<b]for n in R(1<<H)],key=lambda c:(sum(c)<22,sum(c),len(c),sorted(c),c)))
$ 回声 2 4 8 1 8 3| python blackjack.py
 __________ __________ __________ __________
| || || || |
| /\ || /\ /\ || /\ /\ || /\ |
| \/ || \/ /\ \/ || \/ /\ \/ || \/ |
| || /\ \/ /\ || /\ \/ /\ || /\ |
| || \/ /\ \/ || \/ /\ \/ || \/ |
| /\ || /\ \/ /\ || /\ \/ /\ || /\ |
| \/ || \/ \/ || \/ \/ || \/ |
|__________||__________||__________||__________|
$ 回声 1 4 5 4 7 4 8| python blackjack.py
 __________ __________ __________ __________ __________
| || || || || |
| || /\ /\ || /\ /\ || /\ /\ || /\ /\ |
| || \/ \/ || \/ \/ || \/ /\ \/ || \/ \/ |
| /\ || /\ || || /\ \/ /\ || |
| \/ || \/ || || \/ \/ || |
| || /\ /\ || /\ /\ || /\ /\ || /\ /\ |
| || \/ \/ || \/ \/ || \/ \/ || \/ \/ |
|__________||__________||__________||__________||______|

369 个字符

h=map(int,raw_input().split());H=len(h);R=range;j=[]
for n in R(1<<H):c=[h[b]for b in R(H)if n&1<<b];j+=[(sum(c)<22,sum(c),len(c),sorted(c),c)]
for r in R(9):x=["| "[1>r]];print"".join("_ "[0<r<8].join(x+["  \//\__"[ord(('?'*11+'@'*8+'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]]')[r*10+c])*2>>i&6:][:2]for i in 0,2,4]+x)for c in max(j)[-1])

377 个字符

h=map(int,raw_input().split());H=len(h);R=range;j=[]
for n in R(1<<H):c=[h[b]for b in R(H)if n&1<<b];j+=[(sum(c),len(c),sorted(c),c)]*(sum(c)<22)
T="@@@HD@@?@BA@@`P?@BAHD`P?@bQ@@bQ?@bQHDbQ?@bQbQbQ?@bYfQbQ?@bYfYfQ?bQbYfQb]bYfQbYf]"
for r in R(9):x=["| "[1>r]];print"".join("_ "[0<r<8].join(x+["  \//\__"[ord(('?'+T[c*8-8:])[r])*2>>i&6:][:2]for i in 0,2,4]+x)for c in max(j)[-1])

408 个字符

h=map(int,raw_input().split());H=len(h);R=range;j=[]
for n in R(1<<H):c=[h[b]for b in R(H)if n&1<<b];j+=[(sum(c),len(c),sorted(c),c)]*(sum(c)<22)
T="@@@DH@@ @AB@@P` @ABDHP` @Qb@@Qb @QbDHQb @QbQbQb @QfYbQb @QfYfYb QbQfYbQn QfYbQfYn".split();U="\x3f"
for r in R(9):s="_ "[0<r<8];x=["| "[1>r]];print"".join(s.join(x+[("  ","/\\","\/","__")[ord((U+T[c-1]+U)[r])>>i&3]for i in 0,2,4]+x)for c in sorted(j)[-1][-1])
于 2009-12-04T12:18:06.497 回答
9

Golfscript - 228 个字符

' ':x/{~}%:h;9,{:r;h,2\?,{:m;h,,{2\?m&},{h\=}%}%1>{:j[{+}*.22<\j,j$j]}$)\;{:c;[x]3,{4\?'  \//\__'2/[11'?'*8'@'*'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf'8'?'*]']]'+10r*c+=@/3&=}%[x]++' _'1/7r&!=*}%'|':x;n}%
$ 回声 10 9 8 7 6 5 | ../golfscript.rb black.gs
 __________ __________ __________
| || || |
| /\ /\ || /\ /\ || /\ /\ |
| \/ /\ \/ || \/ /\ \/ || \/ \/ |
| /\ \/ /\ || /\ \/ /\ || /\ /\ |
| \/ /\ \/ || \/ \/ || \/ \/ |
| /\ \/ /\ || /\ /\ || /\ /\ |
| \/ \/ || \/ \/ || \/ \/ |
|__________||__________||__________|

231 个字符

' ':x/{~}%:h,2\?,{:m;h,,{2\?m&},{h\=}%}%1>{:j[{+}*.22<\j,j$j]}$-1=:h;9,{:r;h{:c;[x]3,{4\?'  \//\__'2/11'?'*8'@'*'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf'8'?'*']]'++++10r*c+=@/3&=}%[x]++' _'1/7r&!=*}%'|':x;n}%

这个怎么运作

# parse input into a list 
' ':x/{~}%:h
# create the powerset
 ,2\?,{:m;h,,{2\?m&},
# map the powerset onto the cards
{h\=}%}%
# trim the empty set from the powerset
1>
# sort the hands. most preferred hand will be last
{:j[{+}*.22<\j,j$j]}$
# take the preferred hand from the end of the list
-1=:h;
# for r in 0..8
9,{:r
...more to follow
于 2009-12-06T11:22:04.643 回答
4

Perl

公然从gnibbler 的 Python 解决方案中窃取;结果缩短了三个字符,在 362 - 如果在命令行上给出输入。

sub p{(local$z=pop)?(@z=&p,map[@$_,$z],@z):[]}
for(p@ARGV){$t=0;$t+=$_ for@$_;($s,@c)=($t,@$_)if$t>=$s&&$t<22}
for$r(0..8){$x=$r?'|':$";for$c(@c){print+join$r*($r<8)?$":'_',$x,
map(join('',((split//,'  \//\__')[ord((('?')x11,('@')x8,split//,
'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]]'
)[$r*10+$c])*2>>$_&6..7])[0,1]),0,2,4),$x}print$/}

要从标准输入读取,请替换@ARGV@F并使用perl -an; 使用传统的 Perl 高尔夫评分,计为 362。

当然,gnibbler 的其他 Python 技巧也可以复制。

$ perl -pechomp <<'END' \ 
> >'bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]]' 
> sub p{(local$ z=pop)?(@z=&p,map[@$_,$z],@z):[]} 
> for(p@F){$t=0;$t+=$_ for@$_ ;($s,@c)=($t,@$_)if$t>=$s&&$t<22} 
> for$r(0..8){$x=$r?'|': $";for$c(@c){print+join$r*($r<8)?$":'_',$x, 
> map(join('',((split//,' \ //\__')[ord((('?')x11,('@')x8,split//,$0) 
> [$r*10+$c])*2>>$_&6..7 ])[0,1]),0,2,4),$x}print$/} 
> END 
$ wc -c <bb*
287
$回声 10 5 2 9 3 | perl -an bb*
 __________ __________ __________
| /\ /\ || || /\ /\ |
| \/ /\ \/ || /\ || \/ \/ |
| /\ \/ /\ || \/ || /\ /\ |
| \/ \/ || || \/ /\ \/ |
| /\ /\ || || /\ \/ /\ |
| \/ /\ \/ || /\ || \/ \/ |
| /\ \/ /\ || \/ || /\ /\ |
|_\/____\/_||__________||_\/____\/_|
于 2009-12-06T06:15:59.050 回答
3

卢阿,895

好的,现在正确。甚至可以得分1作为王牌。

t=table p=ipairs j=arg x={}r={}o={}b=0 function f()local e,s,n,m=0,0,{}for i,v in p(j)do s=s+v e=e+(v+0==1 and 1 or 0)n[i]=v end t.sort(n)for i,v in p(n)do if o[i]and v~=o[i]then m=v>o[i]break end end while e>0 and s<12 do s=s+10 e=e-1 end if s<=21 and s>b or(s==b and(#j>#r or(#j==#r and m)))then b=s for i=1,#r>#j and #r or #j do r[i]=j[i]o[i]=j[i]end t.sort(o)end if s>0 then for i=1,#j do t.insert(x,t.remove(j,i))f()t.insert(j,i,table.remove(x))end end end f()t={" __________ ","|          |","|__________|","|    /\\    |","| /\\       |","|       /\\ |","| /\\    /\\ |","| \\/ /\\ \\/ |","|_\\/____\\/_|"}c={"12224D223","125E226F3","125E4D6F3","127G227G3","127G4D7G3","127G7G7G3","1278HG7G3","1278H8HG3","17G78HG79","178HG78H9"}for i=1,9 do for j,x in p(r)do v=c[tonumber(x)]:sub(i,i):byte()io.write(v<64 and t[v-48]or(t[v-64]:gsub("[/\\]",{["/"]="\\",["\\"]="/"})))end io.write("\n")end

样本输出:

>lua card.lua 8 9 10 7 
 __________  __________ 
| /\    /\ || /\    /\ |
| \/    \/ || \/ /\ \/ |
| /\    /\ || /\ \/ /\ |
| \/ /\ \/ || \/    \/ |
| /\ \/ /\ || /\    /\ |
| \/    \/ || \/ /\ \/ |
| /\    /\ || /\ \/ /\ |
|_\/____\/_||_\/____\/_|

>lua card.lua 1 4 5 4 7 4 8 
 __________  __________  __________  __________  __________ 
|          ||          ||          ||          ||          |
|          || /\    /\ || /\    /\ || /\    /\ || /\    /\ |
|          || \/    \/ || \/    \/ || \/ /\ \/ || \/    \/ |
|    /\    ||    /\    ||          || /\ \/ /\ ||          |
|    \/    ||    \/    ||          || \/    \/ ||          |
|          || /\    /\ || /\    /\ || /\    /\ || /\    /\ |
|          || \/    \/ || \/    \/ || \/    \/ || \/    \/ |
|__________||__________||__________||__________||__________|

>lua card.lua 1 9 5 5
 __________  __________  __________
|          ||          ||          |
|          || /\    /\ || /\    /\ |
|          || \/    \/ || \/    \/ |
|    /\    ||    /\    ||    /\    |
|    \/    ||    \/    ||    \/    |
|          || /\    /\ || /\    /\ |
|          || \/    \/ || \/    \/ |
|__________||__________||__________|
于 2009-12-03T23:49:51.657 回答
2

Python - 298 个字符

只需像这样重命名脚本

mv blackjack.py '???????????@@@@@@@@bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]].py'

这是脚本

import sys
h=map(int,raw_input().split());H=len(h);R=range
for r in R(9):x=["| "[1>r]];print"".join("_ "[0<r<8].join(x+["  \//\__"[ord(sys.argv[0][r*10+c])*2>>i&6:][:2]for i in 0,2,4]+x)for c in max([[h[b]for b in R(H)if n&1<<b]for n in R(1<<H)],key=lambda c:(sum(c)<22,sum(c),len(c),sorted(c),c)))

和样品运行

$ echo 1 2 3 4 5 | python '???????????@@@@@@@@bb@BBbbbbbQY@AAQQQYYbfH@H@HbffYQD@D@DQQYfb@``bbbbfQY@PPQQQQQbf????????]].py'
__________ __________ __________ __________ __________
| || || || || |
| || /\ || /\ || /\ /\ || /\ /\ |
| || \/ || \/ || \/ \/ || \/ \/ |
| /\ || || /\ || || /\ |
| \/ || || \/ || || \/ |
| || /\ || /\ || /\ /\ || /\ /\ |
| || \/ || \/ || \/ \/ || \/ \/ |
|__________||__________||__________||__________||______|
于 2009-12-09T05:04:38.807 回答
1

Python,632 个字符

from itertools import*
o=sum;q=range;r=filter
l=map(int,raw_input().split())
s=r(lambda x:o(x)<22,chain.from_iterable(imap(combinations,repeat(l),q(len(l)+1))))
s=r(lambda x:o(x)==max(map(o,s)),s)
t=max(([(min(x),x)for x in s if len(x)==max(map(len,s))]))[1]
a=" __________ "
b="|          |"
c="| /\    /\ |";e=c[::-1]
d="| /\       |";l=d[::-1]
g="| \/       |";k=g[::-1]
i="|    /\    |";j=i[::-1]
h="| /\ \/ /\ |";f=h[::-1]
n="|_\/____\/_|"
m="|__________|"
y="aaaaaaaaaabbbbbbbbccbddcccccefbggeeeffchibibichhfejbjbjeefhcbkkcccchefblleeeeechmmmmmmmmnn"
for x in q(9):
 print''.join([globals()[y[x*10:(x+1)*10][v-1]]for v in t])

样本输出:

10 5 7 4 1 1
 __________ __________ __________ __________ __________
| /\ /\ || || || || |
| \/ /\ \/ || /\ /\ || /\ /\ || || |
| /\ \/ /\ || \/ \/ || \/ \/ || || |
| \/ \/ || /\ || || /\ || /\ |
| /\ /\ || \/ || || \/ || \/ |
| \/ /\ \/ || /\ /\ || /\ /\ || || |
| /\ \/ /\ || \/ \/ || \/ \/ || || |
|_\/____\/_||__________||__________||______||______|
于 2009-12-04T12:04:46.033 回答
1

Haskell 最少测试721 个字符

更新的 Haskell 版本,现在据说适用于所有情况,但它可能需要更多测试。

import Data.List --17

--shorteners

m=map --6
r=reverse --10
l=length --9
u=True --7
g=minimum --10

--printing of the cards

p=foldl1(zipWith(++)).m d --26
a=[" __________ ","|          |","| /\\    /\\ |",r(a!!2),"| /\\       |",r(a!!4),"| \\/       |",r(a!!6),"|    /\\    |",r(a!!8),"| /\\ \\/ /\\ |",r(a!!10),"|_\\/____\\/_|","|__________|"] --190
j(Just x)=x --12
d(n+1)=m(j.(flip$lookup)(zip"abcedlgkijhfnm"a).("aaaaaaaaaabbbbbbbbccbddcccccefbggeeeffchibibichhfejbjbjeefhcbkkcccchefblleeeeechmmmmmmmmnn"!!).(+n))[0,10..80] --160

-- interaction and pipeline

main=interact$unlines.p.f.m read.words --39
f x=head.filter((<22).sum).r.sortBy(o x)$x:z x --47

-- generate all possible hands (power set)

z[]=[] --7
z(x:s)=s:m(x:)(z s)++z s --25

-- sorting logic
c f a b=compare(f a)$f b --25

o x a b|l a==l b=s x a b|u=c l a b --35
s o a b|g a==g b=t o a b|u=c g a b --35
t o a b|all(`elem`b)a=c(n o)a b|u=GT --37
n t=m(j.(`elemIndex`t)) --24

Haskell 版本尚未完成 622 个字符

它不会赢得任何选美比赛,我敢肯定也可以改进,并且不完全遵循规范(仍在min(min(3,2), min(1,4))解决问题以及重复过滤(该o功能需要更多案例))。尽管它不完整,但它确实通过了所有给定的测试用例。

每行都带有注释 ( --),其中包含字符数,包括新行。

import Data.List --17
p=foldl1(zipWith(++)).m d --26
r=reverse --10
a=[" __________ ","|          |","| /\\    /\\ |",r(a!!2),"| /\\       |",r(a!!4),"| \\/       |",r(a!!6),"|    /\\    |",r(a!!8),"| /\\ \\/ /\\ |",r(a!!10),"|_\\/____\\/_|","|__________|"] --190
j(Just x)=x --12
d(n+1)=m(j.(flip$lookup)(zip"abcedlgkijhfnm"a).("aaaaaaaaaabbbbbbbbccbddcccccefbggeeeffchibibichhfejbjbjeefhcbkkcccchefblleeeeechmmmmmmmmnn"!!).(+n))[0,10..80] --160
m=map --6

main=interact$unlines.p.snd.f.m read.words --43

f x=head.filter((<22).fst).m(\x->(sum x,x))$r$sortBy o$x:z x --61

c f a b=compare(f a)$f b --25
z[]=[] --7
z(x:s)=s:m(x:)(z s)++z s --25
l=length --9

o a b|l a==l b=GT|True=c l a b --31
于 2009-12-04T14:58:42.897 回答
1

Perl,410 个字符

不知道还有多少改进是可能的,但也许这比 gnibbler 的算法更容易移植到 GolfScript:

sub R{for(@_){substr$q[$_],$B+$z,2,'/\\';substr$q[$_+1],$B+$z,2,'\/';
if($B==2){$B=8;R(8-$_);$B=2}}}
for$i(1..1<<(@p=@ARGV)){$s=$n=0;$i&1<<$n++&&($s+=21*$_+1)for@p;
$q=$s,$N=$i if$s<462&&$q<$s}
@q=($/)x9;for$p(grep$N&1<<$_,0..@p){
s/$/|          |/for@q;
$B=5;($P=$p[$p])&1&&R(4-($P==7));$P-8||R 5,3;$P>9&&R 6,2;
$B=2;if($P>8){R 1,3,5,7}else{R 2if$P>1;R 6if$P>3;R 4if$P>5}$z+=12}
$q[0]=~y/| / _/;$q[-1]=~y/ /_/;print@q
于 2009-12-06T09:17:38.283 回答