Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <iostream>

using namespace std;

int main()
{
int a[101][101],j,i,n,m,s=0,maxi;
cin >> n >> m;
for(i = 1; i <= n; i++)
for(j = 1; j <= m; j++)
cin >> a[i][j];
for( i = 1; i <= n; i++)
{
s=0;
maxi = a[i][1];
for(j = 1; j <= m; j++)
{
if(maxi < a[i][j]) maxi =a [i][j];
s = s+a[i][j];
}
cout << s-maxi<<" ";
}
return 0;
}

You might also like