diff --git a/.gitignore b/.gitignore index efb9a2fdea7c462ec2884be23ad6c5f0863ede6f..12e9fcefc770d21df1870d490ec06d9df4947082 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.o -ex1 -ex2 -ex3 -ex4 +ex1/ex1 +ex2/ex2 +ex3/ex3 +ex4/ex4 diff --git a/ex1/Makefile b/ex1/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..a4ec1c07d164a7449596bca6ecd973a123193651 --- /dev/null +++ b/ex1/Makefile @@ -0,0 +1,20 @@ +TARGET = ex1 +LIBS = -lm +CC = gcc +CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak + +.PHONY: default clean + +default: $(TARGET) + +ex1.o: ex1.c + $(CC) $(CFLAGS) -c $< -o $@ + +run: $(TARGET) + ./$< + +$(TARGET): ex1.o + $(CC) ex1.o $(CFLAGS) $(LIBS) -o $@ + +clean: + rm -f *.o $(TARGET) diff --git a/ex1/ex1.c b/ex1/ex1.c new file mode 100644 index 0000000000000000000000000000000000000000..a741ddf2d9c7cf82f902469c896f2887edd581ca --- /dev/null +++ b/ex1/ex1.c @@ -0,0 +1,45 @@ +/** + * @file ex1.c + * @author Florian Burgener + * @brief Exercice 1 + * @version 1.0 + * @date 2022-01-25 + * + * @copyright Copyright (c) 2021 + * + */ + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main() { + // int32_t values_length = 5; + // double values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // double value; + // scanf("%lf", &value); + // values[i] = value; + // } + + // int32_t values_length = 5; + // int32_t values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // int32_t value; + // scanf("%d", &value); + // values[i] = value; + // } + + // char a[100]; + // int32_t b; + // scanf("%s %d", a, &b); + // printf("%s %d\n", a, b); + + printf("ex1\n"); + return EXIT_SUCCESS; +} diff --git a/ex2/Makefile b/ex2/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..6e37b9ddc4dce7b5994e19fef3fa80df99eff2ea --- /dev/null +++ b/ex2/Makefile @@ -0,0 +1,20 @@ +TARGET = ex2 +LIBS = -lm +CC = gcc +CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak + +.PHONY: default clean + +default: $(TARGET) + +ex2.o: ex2.c + $(CC) $(CFLAGS) -c $< -o $@ + +run: $(TARGET) + ./$< + +$(TARGET): ex2.o + $(CC) ex2.o $(CFLAGS) $(LIBS) -o $@ + +clean: + rm -f *.o $(TARGET) diff --git a/ex2/ex2.c b/ex2/ex2.c new file mode 100644 index 0000000000000000000000000000000000000000..51b4542c34b6ce80c845c2f1ed275e8df8abdc39 --- /dev/null +++ b/ex2/ex2.c @@ -0,0 +1,45 @@ +/** + * @file ex2.c + * @author Florian Burgener + * @brief Exercice 2 + * @version 1.0 + * @date 2022-01-25 + * + * @copyright Copyright (c) 2021 + * + */ + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main() { + // int32_t values_length = 5; + // double values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // double value; + // scanf("%lf", &value); + // values[i] = value; + // } + + // int32_t values_length = 5; + // int32_t values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // int32_t value; + // scanf("%d", &value); + // values[i] = value; + // } + + // char a[100]; + // int32_t b; + // scanf("%s %d", a, &b); + // printf("%s %d\n", a, b); + + printf("ex2\n"); + return EXIT_SUCCESS; +} diff --git a/ex3/Makefile b/ex3/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..3c4cc6b041ec3bc515531853b451a5a5e257d75e --- /dev/null +++ b/ex3/Makefile @@ -0,0 +1,20 @@ +TARGET = ex3 +LIBS = -lm +CC = gcc +CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak + +.PHONY: default clean + +default: $(TARGET) + +ex3.o: ex3.c + $(CC) $(CFLAGS) -c $< -o $@ + +run: $(TARGET) + ./$< + +$(TARGET): ex3.o + $(CC) ex3.o $(CFLAGS) $(LIBS) -o $@ + +clean: + rm -f *.o $(TARGET) diff --git a/ex3/ex3.c b/ex3/ex3.c new file mode 100644 index 0000000000000000000000000000000000000000..c09663fa78feeb35862e8b929634d6c2f96479fa --- /dev/null +++ b/ex3/ex3.c @@ -0,0 +1,45 @@ +/** + * @file ex3.c + * @author Florian Burgener + * @brief Exercice 3 + * @version 1.0 + * @date 2022-01-25 + * + * @copyright Copyright (c) 2021 + * + */ + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main() { + // int32_t values_length = 5; + // double values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // double value; + // scanf("%lf", &value); + // values[i] = value; + // } + + // int32_t values_length = 5; + // int32_t values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // int32_t value; + // scanf("%d", &value); + // values[i] = value; + // } + + // char a[100]; + // int32_t b; + // scanf("%s %d", a, &b); + // printf("%s %d\n", a, b); + + printf("ex3\n"); + return EXIT_SUCCESS; +} diff --git a/ex4/Makefile b/ex4/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0085fc3badd2ccf12f81620e40cb01279ffaac42 --- /dev/null +++ b/ex4/Makefile @@ -0,0 +1,20 @@ +TARGET = ex4 +LIBS = -lm +CC = gcc +CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak + +.PHONY: default clean + +default: $(TARGET) + +ex4.o: ex4.c + $(CC) $(CFLAGS) -c $< -o $@ + +run: $(TARGET) + ./$< + +$(TARGET): ex4.o + $(CC) ex4.o $(CFLAGS) $(LIBS) -o $@ + +clean: + rm -f *.o $(TARGET) diff --git a/ex4/ex4.c b/ex4/ex4.c new file mode 100644 index 0000000000000000000000000000000000000000..900c833c4a38e6abfd6c8584e06a14b000e3bbdf --- /dev/null +++ b/ex4/ex4.c @@ -0,0 +1,45 @@ +/** + * @file ex4.c + * @author Florian Burgener + * @brief Exercice 4 + * @version 1.0 + * @date 2022-01-25 + * + * @copyright Copyright (c) 2021 + * + */ + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main() { + // int32_t values_length = 5; + // double values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // double value; + // scanf("%lf", &value); + // values[i] = value; + // } + + // int32_t values_length = 5; + // int32_t values[values_length]; + + // for (int32_t i = 0; i < values_length; i += 1) { + // int32_t value; + // scanf("%d", &value); + // values[i] = value; + // } + + // char a[100]; + // int32_t b; + // scanf("%s %d", a, &b); + // printf("%s %d\n", a, b); + + printf("ex4\n"); + return EXIT_SUCCESS; +}