From 4a2ad2cc6684c230dd79c950d03277d098e4f93b Mon Sep 17 00:00:00 2001 From: an154gf Date: Thu, 20 Mar 2025 13:57:08 +0100 Subject: [PATCH] aktivita 2 mozno done --- a2/program.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 a2/program.c diff --git a/a2/program.c b/a2/program.c new file mode 100644 index 0000000..cbd43f4 --- /dev/null +++ b/a2/program.c @@ -0,0 +1,29 @@ +#include +#include +#include +// Please implement the header file from the assignment to fulfill the unit tests.. + // You can add any function +#include "pangram.h" + + +bool is_pangram(const char *sentence) { + char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; + char is_char_contained[] = "00000000000000000000000000"; + for (int i = 0; i < sizeof(sentence); i++) { + int iterator = 0; + for (int l = 0; l< 26; l++) { + if (sentence[i] == sentence[iterator]) { + is_char_contained[iterator] = 1; + break; + } + iterator++; + } + } + + for (int i = 0; i<26;i++) { + if (is_char_contained[i] == 0) return 0; + } + return 1; + + return 0; +}