Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- int main(){
- int n;
- scanf("%d", &n);
- int matrica[n][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- scanf("%d", &matrica[i][j]);
- }
- }
- printf("Glavna dijagonala: ");
- for(int i = 0; i < n; i++) {
- printf("%d ", matrica[i][i]);
- }
- return 0;
- }
- /*
- 4
- 88 71 24 77
- 71 32 48 32
- 50 7 39 92
- 19 64 23 1
- 5
- 1 2 3 4 5
- 6 7 8 9 10
- 11 12 13 14 15
- 16 17 18 19 20
- 21 22 23 24 25
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement