Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<map>
- using namespace std;
- int main(){
- string x;
- map<char, char> m;
- //First Line
- m['1']='\´';
- m['2']='1';
- m['3']='2';
- m['4']='3';
- m['5']='4';
- m['6']='5';
- m['7']='6';
- m['8']='7';
- m['9']='8';
- m['0']='9';
- m['-']='0';
- m['=']='-';
- //Second Line
- m['w']='q';
- m['e']='w';
- m['r']='e';
- m['t']='r';
- m['y']='t';
- m['u']='y';
- m['i']='u';
- m['o']='i';
- m['p']='o';
- m['[']='p';
- m[']']='[';
- m['\\']=']';
- //Third Line
- m['s']='a';
- m['d']='s';
- m['f']='d';
- m['g']='f';
- m['h']='g';
- m['j']='h';
- m['k']='j';
- m['l']='k';
- m[';']='l';
- m['\'']=';';
- //Fourth line
- m['x']='z';
- m['c']='x';
- m['v']='c';
- m['b']='v';
- m['n']='b';
- m['m']='n';
- m[',']='m';
- m['.']=',';
- m['/']='.';
- //other
- m[' ']=' ';
- while(getline(cin, x)){
- string::const_iterator i;
- char last;
- for(i=x.begin(); i!= x.end(); i++){
- char c = *i;
- c = (char) tolower(c);
- c = m[c];
- c = (char) toupper(c);
- cout<<c;
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement