Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<map>
- #include<string>
- #include<iostream>
- #include<algorithm>
- #include<fstream>
- #include<ostream>
- 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;
- }
- char a[27] = "abcdefghigklmnopqrstuvwxyz", A[27] = "ABCDEFGHIGKLMNOPQRSTUVWXYZ";
- ofstream out("out.txt");
- int count = 28;
- while (!fs.eof()){
- char eng[256], rus[256];
- fs.getline(eng, 256, '$');
- fs.getline(rus, 256);
- string engword(eng), rusword(rus);
- dict[engword] = rusword;
- //cout << engword[0];
- for (int i = 0; i < 26; i++)
- if ((engword[0] == a[i]) || (engword[0] == A[i])){
- out << rusword;
- out << endl;
- a[i] = '-';
- A[i] = '-';
- count--;
- break;
- }
- if (count = 0)
- break;
- }
- fs.close();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement