Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121278 谭思宸 对角线之和 C++ Compile Error 0 MS 0 KB 411 2025-06-07 10:22:22

Tests(0/0):


Code:

include <bits/stdc++.h> using namespacestd; int main() { int n,i,j,sum=0; scanf("%d",&n); int a[n][n]; for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&a[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(i==j||j==n-1-i){ sum+=a[i][j]; } } } cout<<sum; return 0; }


Run Info:

Main.cc:1:1: error: 'include' does not name a type
 include 
 ^
Main.cc: In function 'int main()':
Main.cc:6:18: error: 'scanf' was not declared in this scope
     scanf("%d",&n);
                  ^
Main.cc:20:5: error: 'cout' was not declared in this scope
     cout<