Uva 10222 Solution

#include<bits/stdc++.h>
#define ch char
using namespace std;
int main()
{
    ch m = 'b', n = 'v', b = 'c', v = 'x', x = 39, z = ';', c = 'z', l = 'j', k='h', j = 'g', h = 'f';
    ch g = 'd', f = 's', d = 'a', s = '\\', a = ']', p = 'i', o = 'u', i = 'y', u = 't', y = 'r', t = 'e';
    ch r = 'w', e = 'q', w = '=', q = '-';
    string an;
    int le, ij;
    while(getline(cin , an))
    {
         le = an.size();
        for(ij=0;ij<le;ij++)
        {
            if(an[ij] >=65 && an[ij] <= 90)
                an[ij] = tolower(an[ij]);

            if(an[ij] == 'm')
                cout <<  m;

            else if(an[ij] == 'n')
                cout <<  n;

            else if(an[ij] == 'b')
                cout <<  b;

            else if(an[ij] == 'v')
                cout <<  v;

            else if(an[ij] == 'x')
                cout <<  x;

            else if(an[ij] == 'z')
                cout <<  z;

            else if(an[ij] == 'c')
                cout <<  c;

            else if(an[ij] == 'l')
                cout <<  l;

            else if(an[ij] == 'k')
                cout <<  k;

            else if(an[ij] == 'j')
                cout <<  j;

            else if(an[ij] == 'h')
                cout <<  h;

             else if(an[ij] == 'g')
                cout <<  g;

             else if(an[ij] == 'f')
                cout <<  f;

             else if(an[ij] == 'd')
                cout <<  d;

             else if(an[ij] == 's')
                cout <<  s;

             else if(an[ij] == 'a')
                cout <<  a;

             else if(an[ij] == 'p')
                cout <<  p;

             else if(an[ij] == 'o')
                cout <<  o;

             else if(an[ij] == 'i')
                cout <<  i;

             else if(an[ij] == 'o')
                cout <<  o;

             else if(an[ij] == 'i')
                cout <<  i;

             else if(an[ij] == 'u')
                cout <<  u;

             else if(an[ij] == 'y')
                cout <<  y;

             else if(an[ij] == 't')
                cout <<  t;

             else if(an[ij] == 'r')
                cout <<  r;

             else if(an[ij] == 'e')
                cout <<  e;

             else if(an[ij] == 'w')
                cout <<  w;

             else if(an[ij] == 'q')
                cout <<  q;

             else if(an[ij] == '/')
                cout <<  ',';

            else if(an[ij] == '.')
                cout << 'm';

            else if(an[ij] == ',')
                cout << 'n';

            else if(an[ij] == 39)
                cout << 'l';

            else if(an[ij] == ';')
                cout << 'k';

            else if(an[ij] == '\\')
                cout << '[';

            else if(an[ij] == ']')
                cout << 'p';

            else if(an[ij] == '[')
                cout << 'o';

            else if(an[ij] == '=')
                cout << '0';

            else if(an[ij] == '-')
                cout << '9';

            else if(an[ij] == '0')
                cout << '8';

            else if(an[ij] == '9')
                cout << '7';

            else if(an[ij] == '8')
                cout << '6';

            else if(an[ij] == '7')
                cout << '5';

            else if(an[ij] == '6')
                cout << '4';

            else if(an[ij] == '5')
                cout << '3';

            else if(an[ij] == '4')
                cout << '2';

            else if(an[ij] == '3')
                cout << '1';

            else if(an[ij] == '2')
                cout << '`';
            else
                cout << an[ij];
        }
        cout << endl;
    }
    return 0;
}

Comments