题解 | 单组_二维数组

单组_二维数组

https://www.nowcoder.com/practice/4df606b6c3764d9c969f8759c8a4807b

#include <iostream>
using namespace std;
long long arr[1007][1007]; 
int main() {
    int n,m;
    cin>>n>>m;
    long long num=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>arr[i][j];
            num+=arr[i][j];
        }
    }
    cout<<num;
    return 0;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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