Răspuns:
#include <iostream>
using namespace std;
int main()
{
int a[20][20],i,n,j,aux,k;
cout<<"n=";cin>>n;
cout<<"k=";cin>>k;
for (i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";cin>>a[i][j];
}
for(j=1;j<=n/2;j++)
if(i>j)
{aux=a[k][j];
a[k][j]=a[k][n/2+1];
a[k][n/2+1]=aux;
}
for(i=1;i<=n;i++)
{for(j=1;j<=n;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
return 0;
}
Explicație: