#include #include #define MAX_WORD_LEN 100 #define ARRAY_SIZE 1000 void revprint(const char *str) { char s[MAX_WORD_LEN + 1] = ""; int index = 0; static const char seps[] = " \n\t,.:;!?"; while (*str && strchr(seps, *str)) str++; if (!*str) return; while (!strchr(seps, *str)) s[index++] = *str++; s[index] = '\0'; if (*str == '\0') { printf("%s ", s); return; } revprint(str); printf("%s ", s); } int main() { char str[ARRAY_SIZE]; printf("bir cumle girin : "); gets(str); revprint(str); return 0; }