var arr=[
[1,2,3,4,5,6],
[12,8,7,9,24,26],
[4,7,8,10,11,13],
[7,9,10,31,22,38],
[8,10,4,5,6],
[9,24,26,5,3,1]
];
var a=arr.length;
var c=0;
var d=0;
for(i=0;i<arr.length;i++){
var b=arr[i].length;
for(j=0;j<b;j++){
if(i%2!=0&&j%2!=0){
c += arr[i][j];
d++;
}
}
}
document.write('平均数='+c/d); |
|