Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1.     for (int j=0;j<n;j++)
  2.             {
  3.                 if (j!==i) 
  4.                 {
  5.                     if (a[i][j]<0)  a[i][j]=-a[i][j];
  6.                     sum1+=a[i][j];
  7.                 }
  8.             }
  9.         for (int i=0;i<n;j++)
  10.             {
  11.                 if (i!==j)
  12.                 {
  13.                     if (a[i][j]<0)  {a[i][j]=-a[i][j];}
  14.                     sum2+=a[i][j];
  15.                 }
  16.             }
  17.         }  
  18.         if (sum2<sum1) {min=sum1;}
  19.     return min;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement