Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,i,j,a[10][10],b[10][10],c[10][10];
cout<<"Introduceti gradul matricei:";
cin>>n;
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
cout<<"A["<<i<<"]["<<j<<"]=";
cin>>a[i][j];
}}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
cout<<"B["<<i<<"]["<<j<<"]=";
cin>>b[i][j];
}}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++){
c[i][j]=a[i][j]+b[i][j];
}}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++)
cout<<c[i][j]<<" ";
cout<<endl;
}
return 0;
}
Explicație: