#include #include #include #include int isVowel(char c) { /* BEGIN ANSWER (a) -- do not delete this line */ // ADD YOUR CODE FOR PART (a) HERE /* END ANSWER (a) -- do not delete this line */ } void rotateWord(char w[], int n) { /* BEGIN ANSWER (b) -- do not delete this line */ // ADD YOUR CODE FOR PART (b) HERE /* END ANSWER (b) -- do not delete this line */ } void printPig(char *w) { /* BEGIN ANSWER (c) -- do not delete this line */ // ADD YOUR CODE FOR PART (c) HERE /* END ANSWER (c) -- do not delete this line */ } /* This line defines a constant LENGTH for the size of arrays */ enum { LENGTH = 256 }; int main() { int c; char word[LENGTH]; /* should be long enough for any word in English! */ int wlen = 0; /* length of word that we've read */ /* read words and non-words, print pigLatin of words and print non-words as is */ while ( (c = getchar()) != EOF ) { /* is c a letter? */ if ( isalpha(c) ) { /* add it to the word */ word[wlen++] = c; if ( wlen >= LENGTH ) { fprintf(stderr,"Reading a word too long to store!\n"); return EXIT_FAILURE; } } else { /* not a letter. If we have a word, print it */ if ( wlen > 0 ) { /* terminate the word */ word[wlen] = '\0'; printPig(word); /* clear the word */ wlen = 0; } /* and print the non-word character */ putchar(c); } } /* print any remaining word */ if ( wlen > 0 ) { word[wlen] = '\0'; printPig(word); } return EXIT_SUCCESS; }