хм, вроде так. смотрю - что-то знакомое. с первого курса такая задачка валяется.
Код:
#include <iostream>
using namespace std;
int main()
{
int n;
int A[50][50];
int B[50];
int i=0,j=0;
cout << "Enter n= "<< endl;
cin >> n;
cout << " Enter matrix A[n][n] = "<< endl;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
cin >> A[i][j];
cout << "\n matrix A[n][n] = "<< endl;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
cout << A[i][j]<< "\t ";
cout << endl;
}
int temp=0,max;
for(i=0;i<n;i++)
{
if(i==0) max=B[i];
temp=0;
for(j=0;j<n;j++)
{
temp=temp+A[i][j];
}
B[i]=temp;
if(B[i]>max) max=B[i];
}
cout << " B[i] = "<< endl;
for(i=0;i<n;i++)
cout << B[i] << endl;
cout << " max = "<<max;
return 0;
}