Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
323095 钟宜辰 【C4-9】方阵对角线 C++ 通过 100 4 MS 252 KB 289 2025-05-17 17:07:07

Tests(2/2):


#include<bits/stdc++.h> using namespace std; int main(){ int a[40][40],n,b[40],s=0; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>a[i][j]; if(i==j){ s++; b[s]=a[i][j]; } } } for(int i=1;i<=s;i++){ cout<<b[i]<<endl; } return 0; }


测评信息: