Advertisement
Josif_tepe

Untitled

May 17th, 2021
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 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.         for(int j = 0; j < m; j++) {
  16.             if(i + j == n - 1) {
  17.                 printf("%d ", matrica[i][j]);
  18.             }
  19.         }
  20.     }
  21.     return 0;
  22. }
  23.  
  24. /*
  25.  4 4
  26.  1 2 3 4
  27.  5 6 7 8
  28.  9 10 11 12
  29.  13 14 15 16
  30.  **/
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement