Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sumofmodules( int **s, int rows, int columns )
- {
- int sum = 0;
- bool isEnought = false;
- int DontGo = 0;
- int BlackAndBlue = 0;
- for ( int i = 0; i < rows && !isEnought ; i++ )
- {
- for ( int j = 0; j < columns ; j++ )
- {
- if (s[i][j] > 0)
- {
- DontGo = i;
- BlackAndBlue = j;
- isEnought = true;
- break;
- }
- }
- }
- for (int i = DontGo; i < rows ; i++)
- {
- for(int j = ++BlackAndBlue; j < columns ; j++)
- {
- sum += abs(s[i][j]);
- }
- BlackAndBlue = -1;
- }
- return sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement