Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
125706 | 范恒恺 | 矩阵右移动 | C++ | Wrong Answer | 1 MS | 272 KB | 365 | 2025-07-15 11:53:55 |
#include<iostream> using namespace std; int a[110][110]; int b[110][110]; 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<m;j++){ int k=(j+m)%n; b[i][k]=a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<b[i][j]<<" "; } } cout<<endl; }
------Input------
2 3 1 2 3 4 5 6 7 8 9
------Answer-----
2 3 1 5 6 4 8 9 7
------Your output-----
2 0 1 5 0 4 8 0 7