Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63754 张江鹏 外围元素之和 C++ Compile Error 0 MS 0 KB 365 2024-01-19 17:44:20

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:5: error: 'sum' was not declared in this scope
     sum+=a[i][j];
     ^
Main.cc:19:8: error: 'sum' was not declared in this scope
  cout<