由买买提看人间百态

topics

全部话题 - 话题: nitercol
(共0页)
w****x
发帖数: 2483
1
来自主题: JobHunting版 - L家phone面,悲剧

这个不对吧, 怎么一横一竖跑两遍就完了呢?? 我贴一个超长版的:
int _inner_search_row(int A[M][N], int nIterRow, int nIterCol, int nTg);
int _inner_search_col(int A[M][N], int nIterRow, int nIterCol, int nTg);
bool FindTarget2(int A[M][N], int nTg)
{
int nIterRow = 0;
int nIterCol = N-1;
while (nIterCol >= 0 && nIterRow < M && A[nIterRow][nIterCol] != nTg)
{
nIterRow = _inner_search_row(A, nIterRow, nIterCol, nTg);
nIterCol = _inner_search_col(A, nIterRow, nIterCol, nTg);
}
return nIt... 阅读全帖
(共0页)