var i=Math.round(Math.random()*100);var j=i%=2; i为产生的1-100的随机数,j为取模运算。 转载于:https://www.cnblogs.com/lovening/archive/2010/09/07/1820746.html