View Single Post
  #1 (permalink)  
Old November 5th, 2011, 04:37 AM
Twister123 Twister123 is offline
Registered User
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote