Question by hisluv: hey guys i tried this exercise at the following site and really found hard time can you help?
Write a program to find the number of times that a given word (i.e. a short string) occurs in a sentence (i.e. a long string!).
Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing.
Typical output should be:
The word is “the”.
The sentence is “the cat sat on the mat”.
The word occurs 2 times.
Best answer:
Answer by John R
Does not look easy. May be you can contact a programming expert at websites like http://askexpert.info/
What do you think? Answer below!






Recent Comments