From c9c9445c9b96e709b1c9e9384eb4c85cc33e06b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pokora?= <s204402@student.pg.edu.pl> Date: Mon, 24 Mar 2025 08:59:13 +0000 Subject: [PATCH] Upload New File --- lab5c.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lab5c.c diff --git a/lab5c.c b/lab5c.c new file mode 100644 index 0000000..64c64b2 --- /dev/null +++ b/lab5c.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +int main(){ // dokoncze w domu by dzialalo + int mat1[2][2] = { + {0,0}, + {0,0} + } + int mat2[2][2]; + printf("Podaj liczby w pierwszej macierzy:"); + for(int i = 0;i<2;i++){ + for(int j = 0;j<2;j++){ + scanf("%i ",&mat1[i][j]); + } + } + printf("\nPodaj liczby w drugiej macierzy:"); + for(int i = 0;i<2;i++){ + for(int j = 0;j<2;j++){ + scanf("%i ",&mat1[i][j]); + } + } + int mat3[2][2]; + mat3[0][0] = mat1[0][0]*mat2[0][0]+mat1[0][2]*mat2[1][0]; + mat3[0][1] = mat1[0][0]*mat2[0][1]+mat1[0][1]*mat2[1][1]; + mat3[1][0] = mat1[1][0]*mat2[0][0]+mat1[1][1]*mat2[1][0]; + mat3[1][1] = mat1[1][0]*mat2[0][1]+mat1[1][1]*mat2[1][1]; + for(int i = 0;i<2;i++){ + for(int j = 0;j<2;j++) + printf("%f ",&mat3[i][j]); + } + + +} -- GitLab