Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125686 陈国川 对角线之和 C++ Compile Error 0 MS 0 KB 325 2025-07-15 11:35:47

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:14: error: lvalue required as left operand of assignment
   if(i=j||i+j=n+1){
              ^
Main.cc:12:5: warning: unused variable 'cnt' [-Wunused-variable]
 int cnt=0;
     ^