Advertisement
Josif_tepe

Untitled

Aug 23rd, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. int main(){
  6.     int n;
  7.     scanf("%d", &n);
  8.    
  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("Elementite nad sporednata dijagonala: ");
  16.     for(int i = 0; i < n; i++) {
  17.         for(int j = 0; j < n - 1 - i; j++) {
  18.             printf("%d ", matrica[i][j]);
  19.         }
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement