| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 140290 | 万骏博 | 对角线之和 | C++ | Accepted | 1 MS | 280 KB | 394 | 2025-12-13 18:12:01 |
#include<bits/stdc++.h> using namespace std; int o[101][101],l,n,m=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ scanf("%d,&n",&o[i][j]); } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(i==j){ m=m+o[i][j]; } else{ if(i+j==n+1){ m=m+o[i][j]; } } } } printf("%d",m); return 0; }