Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include<string>
- #include<map>
- #include<algorithm>
- using namespace std;
- int main() {
- string start, finish;
- ifstream fileIn;
- ofstream fileOut;
- fileIn.open("input.txt");
- fileOut.open("output.txt");
- getline(fileIn, start);
- getline(fileIn, finish);
- map<char, char> symbs;
- for (size_t i = 0; i < start.size(); ++i) {
- symbs[start[i]] = finish[i];
- }
- string line;
- while (getline(fileIn, line)) {
- int cnter = 0;
- for (char x : line) {
- if (symbs.find(x) != symbs.end()) {
- line[cnter] = symbs[x];
- }
- ++cnter;
- }
- fileOut << line <<"\n";
- }
- fileIn.close();
- fileOut.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement