Thank you guys, and you were right. It is very simple. I know this version is O(n) but for a first try, I am happy. I will be working on something better, such as a bst method or something like that.
This version uses '1' and '2' to accept words because std::cin skips whitespace so I cannot get ' ' to show up. Anyway, when we put it in c# it will be much better because then we can just use the onchange event and have a text box to work with. :)