Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<map>
- #include<string>
- using namespace std;
- int main()
- {
- map<char,char> code;
- int n;
- cin>>n;
- while(n--)
- {
- char c1,c2;
- cin>>c1>>c2;
- code[c1]=c2;
- }
- string text;
- cin.ignore();
- getline(cin,text);
- for(int i=0;i<text.length();++i)
- if(code[text[i]])
- text[i]=code[text[i]];
- cout<<text<<endl;
- }
Add Comment
Please, Sign In to add comment