From 0a10914e4f3c5e11f192e6b541ba9cebb3efd679 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Mon, 14 Oct 2024 21:03:47 +0300 Subject: initial commit --- 5_3.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 5_3.c (limited to '5_3.c') 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 -#include - -#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; -} -- cgit v1.2.3-70-g09d2