fork download
  1. #include <iostream>
  2. #include "math.h"
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8. vector <string> words;
  9. for (string temp; cin >> temp;)
  10. words.push_back(temp);
  11. cout << "Number of words: " << words.size() << endl;
  12.  
  13. sort(words);
  14.  
  15. string disliked = "Brocolli";
  16.  
  17. for (int i = 0; i < words.size(); ++i)
  18. if (words[i] == disliked)
  19. cout << "BLEEP" << endl;
  20. else cout << words[i] << endl;
  21.  
  22.  
  23. cin.get();
  24. cin.get();
  25.  
  26. return 0;
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:8:2: error: 'vector' was not declared in this scope
  vector <string> words;
  ^
prog.cpp:8:16: error: expected primary-expression before '>' token
  vector <string> words;
                ^
prog.cpp:8:18: error: 'words' was not declared in this scope
  vector <string> words;
                  ^
prog.cpp:13:12: error: 'sort' was not declared in this scope
  sort(words);
            ^
stdout
Standard output is empty