fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <algorithm>
  5. #include <iterator>
  6. #include <unordered_set>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. ifstream in("file.txt");
  12. unordered_set<string> words;
  13. copy (istream_iterator<string>(in), istream_iterator<string>(),
  14. inserter(words, words.begin()));
  15. copy (words.begin(), words.end(),
  16. ostream_iterator<string>(cout, "\n"));
  17. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Standard output is empty