| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 65250 | 黎瑾萱 | 对角线之和 | C++ | Accepted | 2 MS | 268 KB | 320 | 2024-01-24 16:38:34 |
#include<bits/stdc++.h> using namespace std; int a[11][11]; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } int max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(i+j==n-1||i==j){ max += a[i][j]; } } } cout<<max; return 0; }