题目:将1,2,3,6,7,8,9,这七个数字填写下面的空格里,使等式成立.()+()=()()-()=()()
var data=[1,2,3,6,7,8,9]; function ff(ar,sub) { if(sub.length==0) { pl(ar); } var tmp_sub; var tmp_ar; if(ar==undefined || ar==null)ar=[]; for(var i=0;i<sub.length;i++) { tmp_sub=sub.slice(0); tmp_sub.splice(i,1); tmp_ar=ar.slice(0); tmp_ar.push(sub[i]) ff(tmp_ar,tmp_sub); } } var ex1=0; var ex2=0; var ex3=0; function pl(s) { ex1=s[0]+s[1]; ex2=eval(s[2]+''+s[3])-s[4]; ex3=eval(s[5]+''+s[6]); if(ex1==ex2 && ex2==ex3) { document.body.innerHTML=document.body.innerHTML+s+"<br>" } } ff(null,data);