Advertisement
noler89

Untitled

May 17th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include<map>
  2. #include<string>
  3. #include<iostream>
  4. #include<fstream>
  5. #include<ostream>
  6. #include<clocale>
  7. using namespace std;
  8. int main(int argc, char **argv){
  9. setlocale(LC_ALL, "Russian");
  10. map<string, string>dict;
  11. fstream fs(argv[1]);
  12. if (!fs.is_open()){
  13. cout << "Can not open file" << endl;
  14. return 1;
  15. }
  16. ofstream out("out.txt");
  17. int number = 0;
  18. cin >> number;
  19. while (!fs.eof()){
  20. char eng[256], rus[256];
  21. fs.getline(eng, 256, '$');
  22. fs.getline(rus, 256);
  23. string engword(eng), rusword(rus);
  24. if (engword.length()==number){
  25. out << engword << "$" << rusword;
  26. out << endl;
  27. }
  28. }
  29. fs.close();
  30. out.close();
  31. system("pause");
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement