#include #include #include #include #define SEPARATORS " ,." int count_lowercases_words(char *str) { char *tmp_str = strdup(str); unsigned int count = 0; if (tmp_str == NULL) { printf("Eroare la alocare\n"); return -1; } char *word = strtok(tmp_str, SEPARATORS); while (word) { unsigned int i; for (i = 0; i < strlen(word); i++) { if (isupper(word[i])) { break; } } if (i == strlen(word)) { count++; } word = strtok(NULL, SEPARATORS); } free(tmp_str); return count; } int main(void) { char sentence[] = "Ana are mere, pere si gutui. Gigel nu are nimic."; printf("%d\n", count_lowercases_words(sentence)); return 0; }