Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int n, m;
- scanf("%d%d", &n, &m);
- int matrica[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%d", &matrica[i][j]);
- }
- }
- for(int i = 0; i < n; i++) {
- int pomosna = matrica[i][i];
- matrica[i][i] = matrica[i][n - 1 - i];
- matrica[i][n - 1 - i] = pomosna;
- }
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- printf("%d ", matrica[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement