Write a program to count how many times each distinct word appears in its input .
Some trouble here as well. This is what I am trying:
Now ater escaping rom putting in a new word in the text by pressin ctrl+z it just jumps over word not giving me the ability to give in a new word.Code:#include<iostream> #include<string> #include<vector> using std::cout; using std::cin; using std::string; using std::vector; using std::endl; int main() { cout << "Please enter the word to look for: "; vector<string>text; string x; while(cin >> x) text.push_back(x); cout << "Now enter the word to look for: "; string word; cin >> word; return 0; }