题解 | #矩阵元素定位#

矩阵元素定位

https://www.nowcoder.com/practice/b8e6a46992fe4e11b2822b20561b6d94

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int[][] num = new int[n][m];
        for(int i = 0 ;i < n;i++){
            for(int j = 0; j < m;j++){
                num[i][j] = in.nextInt();
            }
        }
        System.out.println(num[in.nextInt()-1][in.nextInt()-1]);
    }
}

全部评论

相关推荐

12-15 12:50
河北工程大学
sta666:我也是这个国际商业化的,三天,一天一面,就通过了,不过我是后端实习生,好好面感觉能过。
点赞 评论 收藏
分享
11-11 16:40
已编辑
门头沟学院 人工智能
不知道怎么取名字_:这个有点不合理了,相当于已经毕业了,但还是没转正,这不就是白嫖
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务