
获得徽章 7
- <style>
html {
/*兼容FF*/
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'www.w3.org\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
/*兼容IE内核*/
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
/*兼容其它,谷歌之类的*/
-webkit-filter: grayscale(1);
}
</style>展开评论点赞 - 这个怎么解
var arr=[2,3,6,28,76],operator=["+","*","*","/"],want=83;function permutation(t,o){let e=[],r=t.length;return o=o||r,function t(r,a=[]){if(a.length===o)e.push(a);else for(let o=0;o<r.length;o++){let e=r.concat(),n=a.concat();n.push(e[o]),e.splice(o,1),t(e,n)}}(t),e}for(a=permutation(arr),b=permutation(operator),i=0;i<a.length;i++)for(j=0;j<b.length;j++){var nums=a[i],operators=b[j],total=nums[0];for(k=0;k<nums.length-1;k++)total=eval(total+operators[k]+nums[k+1]);total==want&&console.log("here"),console.log(nums,operators,total)}展开评论点赞