Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 505
- int main()
- {
- int A[MAX][MAX], B[MAX][MAX];
- int n;
- scanf("%d%d", &n);
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- scanf("%d", &A[i][j]);
- }
- }
- int glavna = 0;
- for(int i = 0; i < n; i++) {
- glavna += A[i][i];
- }
- int sporedna = 0;
- for(int i = 0; i < n; i++) {
- sporedna += A[i][n - i - 1];
- }
- return 0;
- }
- // niza={7,2,(15),0,3,13,5};
- // 7, 2, 0, 3, 5
- /*
- 7, 2, 0, 0, 3, 0, 5
- nova_niza = {7, 2, 0, 3, 5}
- indeks = 5
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement