标签:
<html>
<head>
<title>参差不齐的数组</title>
<meta charset="utf-8">
<script type="text/javascript">
function getBum(){
var grades = [[88,11],[22,33,66],[15,69,200]];
var total = 0;
var average = 0.0;
for(var row = 0;row<grades.length;row++){
for(var col=0;col<grades[row].length;col++){
total+=grades[row][col];
}
average = total/grades[row].length;
alert(average);
total=0;
average=0;
}
}
</script>
</head>
<body>
<input type="button" value="计算" onclick="getBum()">
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/airycode/p/4832945.html