| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 148816 | 黄睿杰 | 矩阵右移动 | C++ | Accepted | 0 MS | 264 KB | 438 | 2026-03-01 16:42:45 |
#include<bits/stdc++.h> using namespace std; int a[10][10],b[10][10]; 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++){ int t=(j+m)%n; if(t==0) b[i][n]=a[i][j]; else b[i][t]=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; }