function calcard(stack,cards,oper)
{
if (stack.length < 2)
{
return;
}
steps.push(oper);
calcul(stack,oper);
playcards(stack, cards);
steps.pop(oper);
}
function play()
{
var stack = new array();
var cards = new array();
result.value = "";
resultset.length = 0;
for (var i = 0; i < icards.length; i++)
{
if (icards[i].value == "" || isnan(icards[i].value))
{
alert('输入格式不正确');
icards[i].focus();
return false;
}
cards.push(icards[i].value);
}
playcards(stack, cards);
result.value += resultset.tostring();
}
</script>
<body>
<br/>
<input id = 'icards' style='width:80px'/>
<input id = 'icards' style='width:80px'/>
<input id = 'icards' style='width:80px'/>
<input id = 'icards' style='width:80px'/>
<input type='button' value='计算' onclick="play();"/><br/><br/>
计算结果:<br/>
<textarea id = 'result' style='width:440px;height:200px'></textarea>
</body>
</html>