Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
111695 郝王骏程 对角线之和 C++ Compile Error 0 MS 0 KB 567 2025-03-03 20:22:54

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min ) using namespace std; int main(){ int sum=0; int a[11][11]; for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ cin>>a[i][j]; } } for(int i=1;i<=m;i++){ for(int j=1;j<=n;j++){ if(j==i||i+j==n+1){ sum+=a[i][j]; } } cout<<sum; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:20: error: 'm' was not declared in this scope
     for(int i=1;i<=m;i++){
                    ^
Main.cc:11:22: error: 'n' was not declared in this scope
       for(int j=1;j<=n;j++){                
                      ^
Main.cc:15:20: error: 'm' was not declared in this scope
     for(int i=1;i<=m;i++){
                    ^
Main.cc:16:22: error: 'n' was not declared in this scope
       for(int j=1;j<=n;j++){
                      ^
Main.cc:23:1: error: expected '}' at end of input
 }
 ^