算24

<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<style>
pre { display:none }
* { font: 16pt 'Tahoma',sans-serif }
#seq { font: bold 48pt 'Tahoma',sans-serif; color:green; margin-bottom: 0em }
button { padding:0.2em }
.sp { display:-moz-inline-box; display:inline-block; width:0.1em }
</style>
<title>算24</title>
<!-- JS代码在最后面 -->
<pre id='question_pre'>
((2+3)*5)-1
4*(2-1+5)
3*(4-1+5)
4*(3-2+5)
(2-1+3)*6
3*(4-2+6)
(1-2+5)*6
(2-3+5)*6
((2+4)*5)-6
(3-4+5)*6
3*(2-1+7)
4*(1-2+7)
4-1+3*7
4*(2-3+7)
5-2+3*7
1-5+4*7
3*(5-4+7)
2*(6-1+7)
3*6-1+7
6*(1-4+7)
2-6+4*7
1+5*6-7
6*(2-5+7)
3*(6-5+7)
4*(5-6+7)
(1-2+4)*8
4*(1-3+8)
(2-3+4)*8
2*(5-1+8)
(1-3+5)*8
((5-1)*4)+8
(2-4+5)*8
4*(3-5+8)
(6-(1+2))*8
(8-(1+3))*6
3*6-2+8
(1-4+6)*8
4*(2+6)-8
6*(1-5+8)
2+5*6-8
(4+5-6)*8
(7-(1+3))*8
2*(7-3+8)
4*(1+7)-8
((7-3)*4)+8
(1-5+7)*8
3*7-5+8
4*(5-7+8)
(2-6+7)*8
6*(3-7+8)
(4+6-7)*8
6*(5+7-8)
3*(1-2+9)
2*(4-1+9)
1-4+3*9
2-5+3*9
((4-1)*5)+9
4*(2-5+9)
3*(4-5+9)
((6-1)*3)+9
2*(6-3+9)
(9-(1+4))*6
6+(4-2)*9
4*(3-6+9)
3*(5-6+9)
7-1+2*9
((7-2)*3)+9
2*(7-4+9)
3*(4+7)-9
5*7-(2+9)
5+4*7-9
6*(2-7+9)
3*(6-7+9)
6+(7-5)*9
2*8-1+9
1+4*8-9
(9-(2+4))*8
(9-(1+5))*8
2*(8-5+9)
5-8+3*9
4*(5-8+9)
6*(3-8+9)
6*(5+8-9)
8*(1-7+9)
2*(7+9)-8
3*(7-8+9)
4*(7+8-9)
5*8-(7+9)
</pre>
<p id=seq></p>
<p><button onclick='answer.innerHTML = ans'>&nbsp;看答案&nbsp;</button>
&nbsp;&nbsp;<button onclick='next()'>&nbsp;下一题&nbsp;</button></p>
<p id=answer></p>
<script>
d = question_pre.innerHTML.split('\n');
if ((s = d[0]).charCodeAt(s.length - 1) == 13)
    for (i = 0; i <d.length; i++)
        s = d[i], d[i] = s.substr(0, s.length - 1);
for(;;) if ((t = d.pop()).length) { d.push(t); break }

next();

function next() {
    i = Math.round(Math.random() * d.length)
    ans = d[i].split('').join(' ')
    s = d[i].split(/[\+\-\+\*\(\)]/).join(' ')
    seq.innerHTML = s
    answer.innerHTML = ''
}
</script>

 

上一篇:深入了解CSS


下一篇:java的各种类型转换汇总