Run ID:156768

提交时间:2026-07-10 14:21:01

#include<bits/stdc++.h> using namespace std; long long a[1008][1008],b[1008][1008]; int main(){ int n,m; cin>>m>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ b[i][(j+m)%n]=a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<b[i][j]<<" "; } cout<<endl; } return 0; }