Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
32345 zhouhuanyu 玙静 计算矩阵边缘元素之和 C++ 通过 0 MS 260 KB 318 2023-11-30 21:02:10

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int main(){ int n, m, sum = 0; cin >> n >> m; int a[101][101]; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cin >> a[i][j]; if(i == 0 || i == n - 1 || j == 0 || j == m - 1){ sum += a[i][j]; } } } cout << sum; return 0; }


测评信息: