请问下为什么求平均成绩这样写不对
var scoreStr = [["小明",87],["小花",81],["小红",97],["小天",76],["小张",74],["小小",94],["小西",90],["小伍",76],["小迪",64],["小曼",76]];
var sum="0";
for(var i=0;i<10;i++)
{sum+=parseInt(scoreStr[i][1]);}
var a=parseInt(sum/10);
document.write(a);
var scoreStr = [["小明",87],["小花",81],["小红",97],["小天",76],["小张",74],["小小",94],["小西",90],["小伍",76],["小迪",64],["小曼",76]];
var sum="0";
for(var i=0;i<10;i++)
{sum+=parseInt(scoreStr[i][1]);}
var a=parseInt(sum/10);
document.write(a);
2017-03-12
举报