Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93835 | 王思颜 | 外围元素之和 | C++ | Wrong Answer | 1 MS | 268 KB | 386 | 2024-10-19 11:56:07 |
#include<bits/stdc++.h> using namespace std; int a[10][10]; int main(){ int n,m,x; cin>>n>>m; for (int i = 0;i <= n - 1;i++){ for (int j = 0;j <= m - 1;j++){ cin>>a[i][j]; } } for (int i = 0;i <= n - 1;i++){ for (int j = 0;j <= m - 1;j++){ if (i == 0 || i == n - 1 || j == 0 || j == m - 1){ x += a[i][j]; } } } cout<<x; return 0; }
------Input------
1 10 9 0 4 4 7 7 9 4 6 4
------Answer-----
54
------Your output-----
4826966