成绩输出为NAN,有人帮我看看哪错了吗?
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var chengji=scoreStr.split(";");
var shuchu=0;
var pingjun=0;
for(var i =0;i<chengji.length;i++){
var index = chengji[i].indexOf(':');
sum += parseInt (chengji[i].substr(index+1,2));
}
shuchu=sum/chengji.length;
pingjun=Math.round(shuchu);
document.write("--班级总分为:"+pingjun);