The most recent word
Write a function that will find and return most recent word in the given text.
The prototype of the function have to be the following void mostRecent(char *text,char *word)
In char *word your function have to return the most recent word that occurce in the text.
Your program have to be not case-sensitive(ignore case - "Can" and "CAN" are the same words)
Also note than WORD is sequence of letters sepereated by whitespace.
Note. The program have to use pointer.
Input:
First line contains one line that is not longer than 1000 symbols with whitespaces.
Output: The most recent word in UPPER case.
Samples:
№ INPUT OUTPUT
1 Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo BUFFALO
2 Can you can the can with can? CAN
|