Run ID:77533

提交时间:2024-06-10 10:29:15

#include<iostream> using namespace std; int main(){ int n,m,a[114][114],s=0; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; if(i==j) s+=a[i][j]; if(i+j==n-1) s+=a[i][j]; } }for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<setw(5)<<a[i][j]; }cout<<endl; } return 0; }