貌似是这样:
#include <stdio.h>
#define M 3
#define N 3
void add(int A[M][N], int B[M][N], int C[M][N])
{
int i, j;
for(i=0; i<M; i++)
for(j=0; j<N; j++)
C[i][j] = A[i][j] + B[i][j];
}
void main()
{
int A[M][N] = {{1,2,3},{4,5,6},{7,8,9}};
int B[M][N] = {{2,3,4},{5,6,7},{8,9,1}};
int C[M][N];
int i, j;
add(A,B,C);
for(i=0; i<M; i++)
{
for(j=0; j<N; j++)
printf("%d\t", C[i][j]);
printf("\n");
}
}