Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58201 | jdf_zhuangyixin | 数组滚动 | C++ | Accepted | 0 MS | 252 KB | 472 | 2024-12-05 12:00:33 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int ns[n][n],ns2[n][n]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>ns[i][j]; } } for(int i=0;i<n;i++){ if(i==0){ for(int j=0;j<n;j++){ ns2[n-1][j]=ns[i][j]; } } else{ for(int j=0;j<n;j++){ ns2[i-1][j]=ns[i][j]; } } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<ns2[i][j]<<" "; } cout<<endl; } return 0; }