//数组从左到右递增 从上到下递增
public boolean search(int[][] a,int m,int n,int d)
{
int right = n-1,top = 0;
while(right >= 0&& top <m)
{
if( a[top][right] >d)
right--;
if(a[top][right] < d)
top++;
if(a[top][right] == d)
return true;
}
return false;
}