@Dee5, do you know what a "for" loop is? (If not, you should learn that first: there is a handy tutorial on this site).
Then, can you get that for loop to read in 10 successive strings from cin ( i.e., user input)?
For each of the strings read in during that loop you can do what is currently in the while loop.
If you have more than one word per line, or if you have something other than precisely 10 lines, then YOU will have to decide what should signal the end of the input.
Sorry again, so what if I want the user to input the number of items he wants to input and then that will be the limit
Like the program ask the user on the first line that limit