Advertisement
dxvmxnd

Untitled

Dec 6th, 2023
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <fstream>
  2. #include <set> /* !ОБЯЗАТЕЛЬНО ДОБАВИТЬ!!!!!!!!!!!!!!!*/
  3.  
  4. set<string> getPossibleVocabulary() {
  5. setlocale(LC_ALL, "Rus");
  6. system("chcp 1251");
  7.  
  8. set<string> vocabulary = {};
  9. string path = "C:\\Users\\Рустамчик\\Desktop\\опишка\\input.txt";
  10. string word = "";
  11.  
  12.  
  13. ifstream fin(path);
  14. if (!fin.is_open()) {
  15. printf("Какая-то ошибка с файлом.");
  16. }
  17. else {
  18. while (fin >> word) {
  19. vocabulary.insert({ word });
  20. }
  21. }
  22. fin.close();
  23.  
  24.  
  25. return vocabulary;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement