Hi guys! Can you help me please? C
/* this program has to print all words that have double letters but if there're no such words "none" must be printed but only once! for example "the weather is good the grass is green" the output has to be" good grass green" for example "the weather rainy" the output has to be "none" but it prints every time no such word is found */ #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char sentence[200] = { 0 }; printf("Enter your sentence:"); fgets(sentence, 200, stdin); char *word; char limits[] = " , ."; printf("Unique words:"); int n; for (word = strtok(sentence, limits); word; word = strtok(0, limits)) { int check[200] = { 0 }; char* uniqWord = word; for (; *word; ++word) { if (check[*word]++) { printf("none" ); break; } n = 0; if (*word && *(word + n) == *(word+n+1)) { printf("%s ", uniqWord); n++; }} } return 0; }