Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,m,i,j,k;
float S=0;
cout<<"n=";
cin>>n;
cout<<"m=";
cin>>m;
cout<<"k=";
cin>>k;
float a[n][m];
for(i=0;i<n;i++)
for(j=0;j<m;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";
cin>>a[i][j];
}
n++;
j=0;
while(j<m)
{
for(i=n-1;i>k;i--)
a[i][j]=a[i-1][j];
if(i==k)
{
i=0;
j++;
}
}
for(j=0;j<m;j++)
{
for(i=0;i<n;i++)
S=S+a[i][j];
a[k][j]=(S-a[k+1][j])/(n-1);
S=0;
}
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
cout<<a[i][j]<<" ";
cout<<"\n";
}
return 0;
}
Explicație:
C++; Da si tu un mulumesc