Advertisement
dcndrd

10082 - WERTYU

May 19th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<map>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.     string x;
  9.     map<char, char> m;
  10.    
  11.     //First Line
  12.     m['1']='\´';
  13.     m['2']='1';
  14.     m['3']='2';
  15.     m['4']='3';
  16.     m['5']='4';
  17.     m['6']='5';
  18.     m['7']='6';
  19.     m['8']='7';
  20.     m['9']='8';
  21.     m['0']='9';
  22.     m['-']='0';
  23.     m['=']='-';
  24.    
  25.     //Second Line
  26.     m['w']='q';
  27.     m['e']='w';
  28.     m['r']='e';
  29.     m['t']='r';
  30.     m['y']='t';
  31.     m['u']='y';
  32.     m['i']='u';
  33.     m['o']='i';
  34.     m['p']='o';
  35.     m['[']='p';
  36.     m[']']='[';
  37.     m['\\']=']';
  38.  
  39.     //Third Line
  40.     m['s']='a';
  41.     m['d']='s';
  42.     m['f']='d';
  43.     m['g']='f';
  44.     m['h']='g';
  45.     m['j']='h';
  46.     m['k']='j';
  47.     m['l']='k';
  48.     m[';']='l';
  49.     m['\'']=';';
  50.  
  51.     //Fourth line
  52.     m['x']='z';
  53.     m['c']='x';
  54.     m['v']='c';
  55.     m['b']='v';
  56.     m['n']='b';
  57.     m['m']='n';
  58.     m[',']='m';
  59.     m['.']=',';
  60.     m['/']='.';
  61.  
  62.     //other
  63.     m[' ']=' ';
  64.    
  65.     while(getline(cin, x)){
  66.         string::const_iterator i;
  67.         char last;
  68.    
  69.         for(i=x.begin(); i!= x.end(); i++){
  70.              char c = *i;
  71.  
  72.                 c = (char) tolower(c);
  73.                 c = m[c];
  74.                 c = (char) toupper(c);
  75.                 cout<<c;
  76.         }
  77.        
  78.         cout<<endl;
  79.     }
  80.  
  81.  
  82.  
  83.  
  84.     return 0;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement