Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121838 李昊宇 外围元素之和 C++ Wrong Answer 1 MS 272 KB 379 2025-06-08 15:17:20

Tests(0/10):


Code:

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


Run Info:

------Input------
1 10 9 0 4 4 7 7 9 4 6 4
------Answer-----
54
------Your output-----
9