题解 | #最高身高#

最高身高

https://www.nowcoder.com/practice/258fe0c567ac493f9b7bc9d3669d158d

#include <iostream>
using namespace std;
int main() {
    int m, n, a[99][99], max = 0, x, y;
    cin >> m >> n;
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i][j] > max) {
                max = a[i][j];
                x = i + 1;
                y = j + 1;
            } 
        }
    }
    cout << x << " " << y;
}

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务