Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<map>
- #include<string>
- #include<iostream>
- #include<fstream>
- #include<ostream>
- #include<clocale>
- using namespace std;
- int main(int argc, char **argv){
- setlocale(LC_ALL, "Russian");
- map<string, string>dict;
- fstream fs(argv[1]);
- if (!fs.is_open()){
- cout << "Can not open file" << endl;
- return 1;
- }
- ofstream out("out.txt");
- int number = 0;
- cin >> number;
- while (!fs.eof()){
- char eng[256], rus[256];
- fs.getline(eng, 256, '$');
- fs.getline(rus, 256);
- string engword(eng), rusword(rus);
- if (engword.length()==number){
- out << engword << "$" << rusword;
- out << endl;
- }
- }
- fs.close();
- out.close();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement