Run ID:156765

提交时间:2026-07-10 14:16:10

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