Untitled
raw download clone
TEXT
views 23
,
size 453 b
#include <iostream>
using namespace std;
int main()
{
    int n, m, a[105][105], i, j, s = 0, maxim =0, v[101];
    cin >> n >> m;
    for(i=1;i<=n;i++)
        for(j=1;j<=m;j++)
            cin >> a[i][j];
    for(int i = 1; i <= n; i ++)
    {
        s = 0;
        maxim = 0;
        for(int j = 1; j <= m; j ++)
             s += a[i][j], maxim = max(maxim, a[i][j]);

        cout << s-maxim << ' ' ;
    }


    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.