This repository has been archived on 2026-07-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
college-work/Задания по C и C++/c/19.c
T

22 lines
626 B
C
Executable File

/*
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;
}