From c3236bb92b70137d9f0a5d52a672a3495eae23da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Thu, 10 Oct 2024 17:13:14 +0200 Subject: [PATCH] cviko 4 --- .gitignore | 1 + Cviko4_1/Makefile | 12 ++++++++++++ Cviko4_1/types.h | 18 ++++++++++++++++++ Cviko4_2/Makefile | 12 ++++++++++++ Cviko4_2/types.h | 20 ++++++++++++++++++++ Cviko4_3/Makefile | 12 ++++++++++++ Cviko4_3/types.h | 26 ++++++++++++++++++++++++++ 7 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 Cviko4_1/Makefile create mode 100644 Cviko4_1/types.h create mode 100644 Cviko4_2/Makefile create mode 100644 Cviko4_2/types.h create mode 100644 Cviko4_3/Makefile create mode 100644 Cviko4_3/types.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87f6767 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +main* \ No newline at end of file diff --git a/Cviko4_1/Makefile b/Cviko4_1/Makefile new file mode 100644 index 0000000..2d8af15 --- /dev/null +++ b/Cviko4_1/Makefile @@ -0,0 +1,12 @@ +all: main + +CC = clang +override CFLAGS += -std=c11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-unused-result -Wno-unknown-pragmas -pedantic -lm + +main: main.c + $(CC) $(CFLAGS) -O0 ./*.c -o "$@" +run: main + ./main $(ARGS) + +clean: + rm -f main main-* diff --git a/Cviko4_1/types.h b/Cviko4_1/types.h new file mode 100644 index 0000000..fcc2fe2 --- /dev/null +++ b/Cviko4_1/types.h @@ -0,0 +1,18 @@ +/** + * Hlavičkový soubor types.h + * + * OBSAH V TOMTO SOUBROU NEUPRAVUJTE! + */ + +#include + +#ifndef TYPES_H +#define TYPES_H + +// DEKLAROVANÉ HLAVIČKY FUNKCÍ NIJAK NEMĚŇTE + +bool is_alpha(char c); + +bool is_name(char arr[]); + +#endif diff --git a/Cviko4_2/Makefile b/Cviko4_2/Makefile new file mode 100644 index 0000000..2d8af15 --- /dev/null +++ b/Cviko4_2/Makefile @@ -0,0 +1,12 @@ +all: main + +CC = clang +override CFLAGS += -std=c11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-unused-result -Wno-unknown-pragmas -pedantic -lm + +main: main.c + $(CC) $(CFLAGS) -O0 ./*.c -o "$@" +run: main + ./main $(ARGS) + +clean: + rm -f main main-* diff --git a/Cviko4_2/types.h b/Cviko4_2/types.h new file mode 100644 index 0000000..918ca81 --- /dev/null +++ b/Cviko4_2/types.h @@ -0,0 +1,20 @@ +/** + * Hlavičkový soubor types.h + * + * OBSAH V TOMTO SOUBROU NEUPRAVUJTE! + */ + +#include + +#ifndef TYPES_H +#define TYPES_H + +// DEKLAROVANÉ HLAVIČKY FUNKCÍ NIJAK NEMĚŇTE + +int get_max(int array[], int length); + +int get_sum(int array[], int length); + +bool values_are_smaller_than(int array1[], int array2[], int array_length); + +#endif diff --git a/Cviko4_3/Makefile b/Cviko4_3/Makefile new file mode 100644 index 0000000..2d8af15 --- /dev/null +++ b/Cviko4_3/Makefile @@ -0,0 +1,12 @@ +all: main + +CC = clang +override CFLAGS += -std=c11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-unused-result -Wno-unknown-pragmas -pedantic -lm + +main: main.c + $(CC) $(CFLAGS) -O0 ./*.c -o "$@" +run: main + ./main $(ARGS) + +clean: + rm -f main main-* diff --git a/Cviko4_3/types.h b/Cviko4_3/types.h new file mode 100644 index 0000000..adcf916 --- /dev/null +++ b/Cviko4_3/types.h @@ -0,0 +1,26 @@ +/** + * Hlavičkový soubor types.h + * + * OBSAH V TOMTO SOUBROU NEUPRAVUJTE! + */ + +#include + +#ifndef TYPES_H +#define TYPES_H + +// DEKLAROVANÉ HLAVIČKY FUNKCÍ NIJAK NEMĚŇTE + +bool is_in_set(int set[], int length, int value); + +bool is_set(int set[], int length); + +bool is_sorted_set(int set[], int length); + +void print_intersection(int set1[], int set2[], int set1_length, int set2_length); + +void print_union(int set1[], int set2[], int set1_length, int set2_length); + +void print_product(int set1[], int set2[], int set1_length, int set2_length); + +#endif