后面为什么要+1呢?
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var myarr=scoreStr.split(";");
var myarr1=new Array();
var sum=0;
for(var i=0;i<myarr.length;i++)
{
sum +=parseInt(myarr[i].substr(myarr[i].indexOf(":")+1));
}
document.write("班级总分:"+sum+"<br>")
document.write("平均分:"+Math.round(sum/myarr.length))