Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104679 小徐老师 矩阵右移动 C++ Accepted 1 MS 272 KB 515 2025-01-07 19:43:38

Tests(2/2):


Code:

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