#include "stdio.h"
void average(double (*p)[3], int row, double *q)
{
int i, j;
for(i=0; i
*(q+i) = 0;
for(j=0; j<3; j++)
*(q+i) += *(*(p+i)+j);
*(q+i) /= 3;
}
}
void main()
{
double arr[][3] = {{1.1, 2.2, 3.4},
{2.2, 3.3, 4.2},
{3.3, 4.2, 1.3}};
double avg[3];
int i;
average(arr, 3, avg);
printf("averages\n");
for(i=0; i<3; i++)
printf("No.%2d : %.3lf\n", i+1, avg[i]);
}满意请采纳