题解 | #矩阵元素定位#

矩阵元素定位

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

public class Program { public static void Main() { string[] len = System.Console.ReadLine().Split(" "); //行 int row = int.Parse(len[0]); //列 int line = int.Parse(len[1]); int[,] Num = new int[row, line];

    //输入数组元素
    for ( int i = 0; i < row; i++) {
        string[] inPutNum = System.Console.ReadLine().Split(" ");
        for (int j = 0; j < line; j++) {
            Num[i, j] = int.Parse(inPutNum[j]);
        }
    }

    //需要输出的目标位置
    string[] target = System.Console.ReadLine().Split(" ");

    System.Console.WriteLine(Num[int.Parse(target[0]) - 1,
                                 int.Parse(target[1]) - 1]);
}

}

全部评论

相关推荐

黑皮白袜臭脚体育生:简历条例统一按使用了什么技术实现了什么功能解决了问题或提升了什么性能指标来写会好些,如使用布隆过滤器实现了判断短链接是否存在,大大提升了查询速度
点赞 评论 收藏
分享
28小凳也想实习:项目不用一个业务一个轮子吗,刷牛客好多人说要一业务一轮子
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务