#include <stdio.h>
#include <string.h>
void PrintPalindromeWords(char str[], char* delimiter) {
char* word = strtok(str, delimiter);
while (word != NULL) {
int result = _stricmp(word, _strrev(_strdup(word)));
if (result == 0 && strlen(word) >= 3)
puts(word);
word = strtok(NULL, delimiter);
}
}
int main(void)
{
char s[] = "c madam c++ civic java pytyp dart";
PrintPalindromeWords(s, " ");
return 0;
}
/*
run:
madam
civic
pytyp
*/