Cpp program to count the number of times one word appears