Advertisement
Josif_tepe

Untitled

Aug 19th, 2021
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. int main(){
  6.  
  7.     int n;
  8.     scanf("%d", &n);
  9.     int matrica[n][n];
  10.     for(int i = 0; i < n; i++) {
  11.         for(int j = 0; j < n; j++) {
  12.             scanf("%d", &matrica[i][j]);
  13.         }
  14.     }
  15.     printf("Sporedna dijagonala: ");
  16.     for(int i = 0; i < n; i++) {
  17.         printf("%d ", matrica[i][n - i - 1]);
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement