Advertisement
noler89

Untitled

Apr 27th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include<map>
  2. #include<string>
  3. #include<iostream>
  4. #include<algorithm>
  5. #include<fstream>
  6. #include<ostream>
  7. using namespace std;
  8. int main(int argc, char **argv){
  9. setlocale(LC_ALL, "rus");
  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. char a[27] = "abcdefghigklmnopqrstuvwxyz", A[27] = "ABCDEFGHIGKLMNOPQRSTUVWXYZ";
  17. ofstream out("out.txt");
  18. int count = 28;
  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. dict[engword] = rusword;
  25. //cout << engword[0];
  26. for (int i = 0; i < 26; i++)
  27. if ((engword[0] == a[i]) || (engword[0] == A[i])){
  28. out << rusword;
  29. out << endl;
  30. a[i] = '-';
  31. A[i] = '-';
  32. count--;
  33. break;
  34. }
  35. if (count = 0)
  36. break;
  37. }
  38. fs.close();
  39. system("pause");
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement