Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<map>
- #include<string>
- #include<iostream>
- #include<algorithm>
- #include<fstream>
- using namespace std;
- int main(int argc, char **argv){
- setlocale(LC_ALL, "rus");
- map<string, string>dict;
- fstream fs(argv[1]);
- if (!fs.is_open()){
- cout << "Can not open file" << endl;
- return 1;
- }
- while (!fs.eof()){
- char eng[256], rus[256];
- fs.getline(eng, 256, '$');
- fs.getline(rus, 256);
- string engword(eng), rusword(rus);
- dict[engword] = rusword;
- }
- fs.close();
- map<string, string>::iterator it = dict.begin();
- for (int i = 0; i<30; i++, it++){
- cout << it->first << "\t" << it->second << endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement