#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
bool Find(int* matrix, int rows, int columns, int number)
{
bool found = false;
if(matrix != NULL && rows > 0 && columns > 0)
{
int x = 0;
int y = columns - 1;
while(x < rows && y >=0)
{
if(matrix[x * columns + y] == number)
{
found = true;
break;
}
else if(matrix[x * columns + y] > number)
y--;
else
x++;
}
}
return found;
}
int main()
{
int sz[] = { 1, 2, 3,
4, 5, 6,
7, 8, 9 };
int b = Find(sz,3,3,5);
printf("resultl = %d\n",b);
return 0;
}