Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<vector>
  4. #include<algorithm>
  5. #include<cmath>
  6. using namespace std;
  7. inline void keep_window_open() { char ch; cin >> ch; }
  8.  
  9. int main()
  10. {
  11.     string bad_word = "broccoli";
  12.     cout << "type words\n";
  13.     vector <string> words;
  14.     for (string temp; cin >> temp; )
  15.         words.push_back(temp);
  16.     cout << "just stuff";
  17.     cout << "so far we have " << words.size() << " words in vector 'words'.\n";
  18.  
  19.     for (string word : words) {
  20.         if (word != bad_word)
  21.             cout << word;
  22.         else
  23.             cout << "BLEEP";
  24.     }
  25.  
  26.     keep_window_open();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement