Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix[0][0]=1;
- matrix[0][1]=2;
- matrix[0][2]=3;
- matrix[1][0]=0;
- matrix[1][1]=0;
- matrix[1][2]=1;
- matrix[2][0]=3;
- matrix[2][1]=4;
- matrix[2][2]=3;
- while(indexRows < ROWS)
- {
- for ( indexCols = 0; indexCols < COLS; indexCols++)
- maxrow += matrix[indexRows][indexCols];
- if (maxrow > finalmaxR)
- {
- finalmaxR = maxrow;
- numRow = indexRows;
- indexRows++;
- }
- else
- indexRows++;
- maxrow = 0;
- }
- cout << numRow <<endl;
- while(indexCols < COLS)
- {
- for ( indexRows = 0; indexRows < ROWS; indexRows++)
- maxcol += matrix[indexRows][indexCols];
- if (maxcol > finalmaxC)
- {
- finalmaxC = maxcol;
- numCol = indexCols;
- indexCols++;
- }
- else
- indexCols++;
- maxcol = 0;
- }
- cout << numCol<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement