Răspuns:
{
int n,i,j;
float S1=0,S2=0;
cout<<"n=";
cin>>n;
int a[n][n];
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
cout<<"a["<<i<<"]["<<j<<"]=";
cin>>a[i][j];
if(i==j)
S1=S1+a[i][j];
if(i+j==n+1)
S2=S2+a[i][j];
}
cout<<S1<<" "<<S2/n;
return 0;
}
Explicație:
Multumesc+5*+cel mai inteligent raspuns?