Advertisement
Josif_tepe

Untitled

May 17th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5.     int n, m;
  6.     scanf("%d%d", &n, &m);
  7.     int matrica[n][m];
  8.     for(int i = 0; i < n; i++) {
  9.         for(int j = 0; j < m; j++) {
  10.             scanf("%d", &matrica[i][j]);
  11.         }
  12.     }
  13.    
  14.     for(int i = 0; i < n; i++) {
  15.         printf("%d ", matrica[i][n - 1 - i]);
  16.     }
  17.     return 0;
  18. }
  19.  
  20. /*
  21.  4 4
  22.  1 2 3 4
  23.  5 6 7 8
  24.  9 10 11 12
  25.  13 14 15 16
  26.  **/
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement