mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
30 lines
485 B
C
30 lines
485 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int m, n, mat[10][10];
|
||
|
|
||
|
int main() {
|
||
|
scanf("%d%d", &m, &n);
|
||
|
|
||
|
m %= n;
|
||
|
|
||
|
for (int i = 0; i < n; i++) {
|
||
|
for (int j = 0; j < n; j++) {
|
||
|
scanf("%d", &mat[i][j]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
for (int i = 0; i < n; i++) {
|
||
|
for (int j = n - m; j < n; j++) {
|
||
|
printf("%d ", mat[i][j]);
|
||
|
}
|
||
|
|
||
|
for (int j = 0; j < n - m; j++) {
|
||
|
printf("%d ", mat[i][j]);
|
||
|
}
|
||
|
|
||
|
printf("\n");
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|