Advertisement
stranger465

Untitled

Oct 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // nastyafile.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <fstream>
  6. #include <iostream>
  7. #include <string>
  8. #include <sstream>
  9. #include <map>
  10.  
  11.  
  12. int main()
  13. {
  14. std::ifstream fin("1.txt", std::ios::in);
  15. std::string str,tmp,t;
  16. char * fuck=new char[1024];
  17. std::istringstream iss;
  18. std::map<std::string, std::string> dictionary;
  19. if (!fin.is_open())
  20. return 0;
  21. while (!fin.eof())
  22. {
  23. getline(fin, str);
  24. iss.str(str);
  25. (iss >> tmp, tmp);
  26. t = iss.str();
  27. t.erase(t.begin(), t.begin() + tmp.size() + 1);
  28.  
  29. dictionary.insert(std::pair<std::string, std::string>(tmp,t));
  30. //dictionary.insert(std::pair<std::string, std::string>((iss >> tmp, tmp), (t=iss.str(), t.erase(t.begin(), t.begin() + tmp.size()+1),t)));
  31. }
  32. _gettch();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement