Untitled
raw download clone
CPP
views 17
,
size 521 b
#include <iostream>
using namespace std;

int main()
{
    int n , m , s = 0 , a[101][101] , mini = 0;
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++)
            cin >> a[i][j];
    for(int i = 1; i <=n; i++)
       {
        s = 0;
        mini = 0;
           for(int j = 1; j <= m; j++)
           {
               if(mini < a[i][j])
                   mini = a[i][j];
               s = s + a[i][j];
           }
        cout <<s-mini<<" ";
       }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.