#include <stdio.h> #include <string.h> #include <ctype.h> int main() { char input[10001]; while(fgets(input, sizeof(input), stdin) != NULL) { // printf("%s\n", input); int len = strlen(input); char output[500][21]; int outputIndex = 0; for(int i = 0; i < len; i++) { if(isalpha(input[i])) { int j = 0; while(isalpha(input[i])) { output[outputIndex][j++] = input[i]; i++; } outputIndex++; } } for(int i = outputIndex - 1; i > 0 ; i--) { printf("%s ", output[i]); } printf("%s", output[0]); } }