{
var exp;
var ret;
exp = genExpress(expn,a,b,c,d,m1,m2,m3);//生成计算表达式
eval("ret = "+exp);
if ( ret - 24 < 0.1 && ret - 24 = 0 )
{
exp = exp.replace(";","");
exp = replaceAll(exp,"*","×");
exp = replaceAll(exp, "/","÷");
var have = false;
for ( var i=0; i<counter; i++)
{
if ( exp == answer[i] )
{
have = true;
break;
}
}
if ( !have )
{
answer[counter] = exp;
counter++;
log("<font color=red<b"+counter+": "+exp+"</b</font");
} (本文来源于图老师网站,更多请访问http://m.tulaoshi.com)
}
}
function replaceAll (streng, soeg, erstat)
{
var st = streng;
if (soeg.length == 0)
return st;
var idx = st.indexOf(soeg);
while (idx = 0)
{
st = st.substring(0,idx) + erstat + st.substr(idx+soeg.length);
idx = st.indexOf(soeg);
}
return st;
}
var n = new Array();//四个数字
//接收四个输入框的数字,调用主程序
function funCount()
{
n[0] = document.forms[0].fa.value;
n = document.forms[0].fb.value;
n = document.forms[0].fc.value;
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com)