fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <map>
  4. #include <algorithm>
  5. #include <cstdlib>
  6. #include <iterator>
  7. #include <fstream>
  8. using namespace std;
  9. int main() {
  10. int i = 0;
  11. map<string, string> data;
  12. ifstream fin("D:\\text.txt");//файл в котором логинпароль
  13. if (!fin.is_open()) {
  14. cout << "Error";
  15. system("PAUSE");
  16. return 0;
  17. }
  18. string pass, log,temp;
  19. char buf;
  20. while (!fin.eof()) {
  21. fin >> temp;
  22. while (i < temp.size() && temp[i] != ':')
  23. log += temp[i++];
  24. while (i < temp.size())
  25. pass += temp[i++];
  26. i = 0;
  27. data.insert(make_pair(pass, log));
  28. log.clear(), pass.clear();
  29. }
  30. fin.close();
  31.  
  32. ofstream fout("D:\\CompleteFile.txt");// файл конечный
  33. for (auto i:data) {
  34. fout << (i).second << (i).first << endl;
  35. }
  36. fout.close();
  37. cout<<"OK";
  38. system("PAUSE");
  39. return 0;
  40. }
Success #stdin #stdout #stderr 0s 3416KB
stdin
Standard input is empty
stdout
Error
stderr
sh: 1: PAUSE: not found