1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】12.函数3/6-4 求出二维数组的最大元素及其所在的坐标.c

15 lines
277 B
C
Raw Normal View History

2024-11-27 02:25:12 +00:00
// int Row, Col;
int fun(int array[N][M]) {
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
if (array[i][j] > array[Row][Col]) {
Row = i;
Col = j;
}
}
}
return array[Row][Col];
}