aboutsummaryrefslogtreecommitdiffstats
path: root/5_3.c
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov@twistea.su>2024-10-14 21:03:47 +0300
committerjustanothercatgirl <sotov@twistea.su>2024-10-14 21:03:47 +0300
commit0a10914e4f3c5e11f192e6b541ba9cebb3efd679 (patch)
treecbc2239aa2f7cea5f94abe75f3bcd01d77eb24b1 /5_3.c
parentf5e0076a8455eec5b4a515b39202217f8a8b9e71 (diff)
initial commit
Diffstat (limited to '5_3.c')
-rw-r--r--5_3.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/5_3.c b/5_3.c
deleted file mode 100644
index bc91e08..0000000
--- a/5_3.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <time.h>
-
-#include "matrix.h"
-
-int main(void) {
- srand(time(NULL));
- // выбираем размер матрицы
-size_selection:
- printf("Input the size of the matrixes:\n");
- isz size;
- scanf("%zu", &size);
- if (size < 0) {
- SKIP_INPUT;
- goto size_selection;
- }
- // выбираем интервал для генерации случайных чисел
-interval_selection:
- SKIP_INPUT;
- printf("Input the borders of the interval for generated values, separated by a whitespace:\n");
- double a, b;
- if (scanf("%lf %lf", &a, &b) != 2) goto interval_selection;
- // создаём матрицы
- struct tumatrix A = tumatrix_new(size);
- struct tumatrix B = tumatrix_new(size);
- tumatrix_fill(&A, a, b);
- tumatrix_fill(&B, a, b);
- puts("A = "); tumatrix_print(&A);
- puts("B = "); tumatrix_print(&B);
- printf("det A = %lf\n", tumatrix_det(&A));
- printf("det B = %lf\n", tumatrix_det(&B));
- struct tumatrix C = tumatrix_mul(&A, &B);
- puts("C = A*B = "); tumatrix_print(&C);
- printf("det C = %lf\n", tumatrix_det(&C));
- tumatrix_free(A);
- tumatrix_free(B);
- tumatrix_free(C);
- return 0;
-}