9.9用友第二题输入处理


本地测试时用 ctrl+d 结束输入,不用管输入什么时候结束。
  Scanner scanner = new Scanner(System.in);
        List<String> list = new ArrayList<>();
        while (scanner.hasNext()) {
            list.add(scanner.nextLine());
        }

        int m = list.size();
        String[] str1 = list.get(0).split(",");
        int n = str1.length;

        int[][] matrix = new int[m][n];

        for (int i = 0; i < m; i++) {
            String[] strs = list.get(i).split(",");
            for (int j = 0; j < n; j++) {
                matrix[i][j] = Integer.valueOf(strs[j]);
            }
        }



#用友##用友校招#
全部评论

相关推荐

林后润:听说他们有kpi,要到了简历编号就不理人了
27届求职交流
点赞 评论 收藏
分享
03-10 11:23
门头沟学院 Java
鹿LF:计算机面试就跟数学题一样,没什么实际价值,但只能这么筛选,本质是考察你的努力,智力和学习能力
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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