#include <iostream>
using namespace std;
int T[50][50];
int main()
{
int n, i, j, temp;
cout << "n="; cin >> n;
cout << "introdu " << n*n << " elemente a matricei: \n";
for (i=1; i<=n; ++i)
for (j=1; j<=n; ++j)
cin >> T[i][j];
for (i=1; i<=n; ++i)
{
temp=T[i][i];
for (j=1; j<=n; ++j)
T[i][j]=T[i][j] + temp;
}
cout << "Tabloul modificat: " << endl;
for (i=1; i<=n; ++i)
{
for (j=1; j<=n; ++j)
cout << T[i][j] << " ";
cout << "\n";
}
return 0;
}