用C语言编写一个函数函数头格式为double Meandouble aMNint mint n要求返回二维数组amn中所有元素的平均值假定在计算过程中采用变量v存放平均值。
double Mean(double a[M][N], int m, int n)
{
double v = 0.0;
int i, j;
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
v += a[i][j];
}
}
return v / (m * n);
}
原文地址: https://www.cveoy.top/t/topic/hqPJ 著作权归作者所有。请勿转载和采集!