# javascript基礎執行個體:如何計算24點(3)

n = document.forms[0].fd.value;
if ( n[0] > 0 && n > 0 && n > 0 && n > 0 && n[0] < 14 && n < 14 && n < 14 && n < 14 )
{
log("<font size=5><b>"+n[0]+", "+n+", "+n+", "+n+"的24點答案：</b></font><br>");
log("<input type='button' ><br>");
funMain();
if ( counter == 0 )
{
log("沒有答案！");
}
}
else
{
}
}

//主程式
function funMain()
{
var m = new Array();
//四種運算子
m[0] = "+";
m = "-";
m = "*";
m = "/";

//11種運算式
var exp1 = "a m1 b m2 c m3 d;";
var exp2 = "(a m1 b) m2 c m3 d;";
var exp3 = "(a m1 b m2 c) m3 d;";
var exp4 = "((a m1 b) m2 c) m3 d;";
var exp5 = "(a m1 (b m2 c)) m3 d;";
var exp6 = "a m1 (b m2 c) m3 d;";
var exp7 = "a m1 (b m2 c m3 d);";
var exp8 = "a m1 ((b m2 c) m3 d);";

## Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

## Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

## Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth \$300-1200 USD