#include<iostream>
using namespace std;
void main()
{
int person[5][5], i, j, max;
for(i=0;i<5;i++)
for (j = 0; j < 4; j++)
{
cin >> person[i][j];
}
for (i = 0; i < 5; i++)
person[i][4] = 0;
for (j = 1; j < 4; j++)
{
person[0][4] += person[0][j];
person[1][4] += person[1][j];
person[2][4] += person[2][j];
person[3][4] += person[3][j];
person[4][4] += person[4][j];
}
for (i = 0; i < 5; i++)
{
for (j = 0; j < 5; j++)
{
cout << person[i][j] << " ";
}
cout << "\n";
}
for (i = 0; i < 4; i++)
{
max = person[0][4];
if (person[i][4] > person[0][4])
max = person[i][4];
}
cout << person[i][0] << " " << "max=" << max;
getchar();
getchar();
}
using namespace std;
void main()
{
int person[5][5], i, j, max;
for(i=0;i<5;i++)
for (j = 0; j < 4; j++)
{
cin >> person[i][j];
}
for (i = 0; i < 5; i++)
person[i][4] = 0;
for (j = 1; j < 4; j++)
{
person[0][4] += person[0][j];
person[1][4] += person[1][j];
person[2][4] += person[2][j];
person[3][4] += person[3][j];
person[4][4] += person[4][j];
}
for (i = 0; i < 5; i++)
{
for (j = 0; j < 5; j++)
{
cout << person[i][j] << " ";
}
cout << "\n";
}
for (i = 0; i < 4; i++)
{
max = person[0][4];
if (person[i][4] > person[0][4])
max = person[i][4];
}
cout << person[i][0] << " " << "max=" << max;
getchar();
getchar();
}