1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】8.数组2/7-27 数组-矩阵最小值.c

32 lines
573 B
C

#include <stdio.h>
int m, n, mat[25][25], min, min_i, min_j;
int main() {
scanf("%d%d", &m, &n);
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
scanf("%d", &mat[i][j]);
}
}
min = mat[1][1];
min_i = 1;
min_j = 1;
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (mat[i][j] < min) {
min = mat[i][j];
min_i = i;
min_j = j;
}
}
}
printf("%d %d %d\n", min, min_i, min_j);
return 0;
}