feat: Initial commit

This commit is contained in:
2024-03-22 17:14:57 +01:00
parent dc83234df1
commit db9bafe755
45 changed files with 1996 additions and 0 deletions

19
TemiEsame/sommaCornici.c Normal file
View File

@@ -0,0 +1,19 @@
#include <string.h>
#include <stdio.h>
#define MAXN 10
int sommaCornici(int mat[MAXN][MAXN], int N, int vet[]) {
int c = N / 2;
for (int i = 0; i < c; i++) {
vet[i] = mat[i][i] + mat[N-i-1][i] + mat[N-i-1][N-i-1] + mat[N-i-1][N-i-1];
for (int j = i; j < N-i-1; j++) {
vet[i] += mat[i][j] + mat[j][i] + mat[N-i-1][j] + mat[j][N-i-1];
}
}
if (N % 2 == 1) {
vet[c+1] = mat[c][c];
}
}