最佳答案
1方法:通过嵌套的两个for循环来遍历二维数组2代码#include<stdio.h>void Find(int num, int arr[3][2], int row, int col){for (int i = 0; i < row; i++){for (int j = 0; j < col; j++){if (arr[i][j] == num){printf("找到了,行列下标为(%d,%d)\n", i, j);return;}}}puts("没找到");}int main(){int arr[3][2] = { { 1, 2 }, { 3, 4 }, { 5, 6 } };int num;scanf("%d", &num);Find(num, arr, 3, 2);getchar();getchar();return 0;}3运行效果