A(a1,a2,a3,a4),B(b1,b2,b3,b4),C(c1,c2,c3,c4,c5)
begin:
?A,B
1: if = then
?(a1,a2,a3),(c1,c2,c3)
1.1 if = then
1.1.1 ? a1,c4
if = then out(c5) else out (c4)
1.2 if > then
1.2.1 ? c1,c2
if = then out(c3) else(if > then out(c2)
else out(c1)
1.3 if < then
1.3.1 ? c1,c2
if = then out(c3) else(if > then out(c1)
else out(c2)
2: if > then
?(a1,c1,b3),(b1,b2,a2)
2.1 if < then
2.1.1 ? c1,b3
if = then out(a2)
else out(b3)
OK! Now,结果为>,有(a1,c1)>(b1,b2),结果为=,有(a3,a4)>(b4,c1) /推理得到
2.2 if > then
2.2.1 ?(a1,b1),(c1,c2)
if = then out(b2)
if < then out(b1)
if > then out(a1)
2.3 if = then
2.2.1 ?(a3,b4),(c1,c2)
if = then out(a4)
if < then out(b4)
if > then out(a3)
3: if <........
if A=B then 坏球在a, b, c, d, e中
if 123==abc then 坏球在d, e中
if 1=d then 坏球是e
else 坏球是d
elseif 123>abc then 坏球在a, b, c中且轻
if 1a=2b then坏球是c
elseif 1a>2b then 坏球是b
else 坏球是a
elseif 123<abc then 坏球在abc中且重
if 1a=2b then坏球是c
elseif 1a>2b then 坏球是a
else 坏球是b
elseif A>B then 坏球在12345678中
if 34567=abcde then 坏球在128且1 or 2>8
if 28=ab then 坏球是1
elseif 28>ab then 坏球是2
else 坏球是8
elseif 34567>abcde then 坏球为3, 4且重
if 3=a then 坏球是4
else 坏球是3
else 坏球为567且轻
if 5a=6b then 坏球是7
elseif 5a>6b 坏球是6
else 坏球是5
else 坏球在12345678中
if 34567=abcde then 坏球在128且1 or 2<8
if 28=ab then 坏球是1
elseif 28>ab then 坏球是8
else 坏球是2
elseif 34567>abcde then 坏球为567且重
if 5a=6b then 坏球是7
elseif 5a>6b 坏球是5
else 坏球是6
else 坏球为3, 4且轻
if 3=a then 坏球是4
else 坏球是3
Last year I invented a balance, and it can show 12 digits for 12 different balls (or same balls) one time.So it need only one time to get the ball we want!