#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int f(int a[],int b[],int n)
{
int i;
int j;
int c[10][10]={0};
for(i=0;i<n;i++)
{for(j=0;j<n;j++)
{ c[i][j]=a[i][j]+b[i][j];
}
}
for(i=0;i<n;i++)
{for(j=0;j<n;j++)
{
printf("%d",&c[i][j]);
}
}
return 0;
}
int main()
{
int n,i,j;
int a[10][10],b[10][10]={0};
printf("please input the number\n");
scanf("%d",&n);
printf("please input the numbers of a\n");
for(i=0;i<n;i++)
{for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("please input the numbers of b\n");
for(i=0;i<n;i++)
{for(j=0;j<n;j++)
{
scanf("%d",&b[i][j]);
}
}
f(a,b,n);
return 0;
}
求帮忙看看呗!小白看不出啥错误来,改了一下午了哭哭