Работы по программированию

This commit is contained in:
IgorVolochay
2026-07-28 09:56:54 +03:00
parent b85155ff95
commit 8602b7e845
73 changed files with 4090 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
/*
19.Вычислить определитель матрицы 3x3.
*/
#include <stdio.h>
#define N 3
int getDet(int (*matrix)[N]) {
return matrix[0][0]*matrix[1][1]*matrix[2][2] + matrix[0][1]*matrix[1][2]*matrix[2][0] + matrix[0][2]*matrix[1][0]*matrix[2][1] - matrix[0][2]*matrix[1][1]*matrix[2][0] - matrix[0][1]*matrix[1][0]*matrix[2][2] - matrix[0][0]*matrix[1][2]*matrix[2][1];
}
int main() {
int matrix[N][N] = {{6, 3, 0},
{4, 1, -3},
{-2, -3, 2}
};
printf("Det: %d", getDet(matrix));
return 0;
}