This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool Find(int *matrix, int rows, int columns, int number) { | |
bool found = false; | |
if(matrix != nullptr && rows > 0 && columns > 0) { | |
int row = 0; | |
int column = columns-1; | |
while(row < rows && column >= 0) { | |
if(matrix[row * columns + column] == number) { | |
found = true; | |
break; | |
} |
NewerOlder