题解 | 多组_二维数组_T组形式

多组_二维数组_T组形式

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

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        
        int t = in.nextInt();
        while(t-- > 0){
            int raw = in.nextInt();
            int col = in.nextInt();
            long sum  = 0;
            for(int i = 0; i < raw; i++){
                for(int j = 0; j < col; j++){
                    sum += in.nextInt();
                }
            }
            System.out.println(sum);
        }
    }
}

全部评论

相关推荐

这是什么操作什么意思,这公司我服了...
斯派克spark:意思是有比你更便宜的牛马了
点赞 评论 收藏
分享
码农索隆:想看offer细节
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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