Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155313 令狐文丽 矩阵对角线 C++ Accepted 11 MS 664 KB 402 2026-06-06 15:28:37

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a[1001][1001]; int n,m; cin>>n>>m; for(int i =1;i<=n;i++){//行 x for(int j =1;j<=n;j++){//列 y cin>>a[i][j]; } } for(int j =1;j<=n;j++){ for(int i=1;i<=n;i++){ if(i==j or i+j==n+1) printf("%5d",a[j][i]+m); else printf("%5d",a[j][i]); } cout<<endl; } return 0; }