Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118395 马珺宇 外围元素之和 C++ Compile Error 0 MS 0 KB 413 2025-04-29 18:49:42

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:26: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
             if(i==1||i==n&&j==1||j==m){
                          ^
Main.cc:20:1: error: expected '}' at end of input
 }
 ^
Main.cc:20:1: error: expected '}' at end of input