lkyLKY(祝忘羡99版) • 5天前
int main() {
int n, m;
scanf("%d %d", &n, &m);
int a[100][100];
int x = -1;
int r = 1, c = 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%d", &a[i][j]);
int b = abs(a[i][j]);
if (b > x) {
x = b;
r = i + 1;
c = j + 1;
} else if (b == x) {
if (i + 1 < r || (i + 1 == r && j + 1 < c)) {
r = i + 1;
c = j + 1;
}
}
}
}
printf("%d %d %d\n", a[r - 1][c - 1], r, c);
return 0;
}
评论:
请先登录,才能进行评论