Advertisement
Josif_tepe

Untitled

Aug 23rd, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 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 glavnata dijagonala: ");
  16.    
  17.     for(int i = 0; i < n; i++) {
  18.         for(int j = i + 1; j < n; j++) {
  19.             printf("%d ", matrica[i][j]);
  20.         }
  21.     }
  22.    
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement