pvjc25/a2/program.c
2025-03-20 13:57:08 +01:00

30 lines
662 B
C

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// 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;
}