Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 3ms
Memory: 2016kB
Author: CT12810601281
In contest: 1281

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int i,len;
  char str[100];
  while(cin>>str)
  {
    len = strlen(str);
    for(i = 0;i<len;i++)
    {
      if(str[i]>='A'&&str[i]<='Y')
        {
          str[i]+=33;
        }
      else if(str[i]=='Z')
        {
          str[i] = 'a';
        }
        else
        {
          if(str[i]>='a'&&str[i]<='c')
            {
              str[i] = '2';
            }
          if(str[i]>='d'&&str[i]<='f')
            {
              str[i] = '3';
            }
          if(str[i]>='g'&&str[i]<='i')
            {
              str[i]='4';
            }
            if(str[i]>='j'&&str[i]<='l')
              {
                str[i] = '5';
              }
            if(str[i]>='m'&&str[i]<='o')
              {
                str[i] = '6';
              }
            if(str[i]>='p'&&str[i]<='s')
              {
                str[i]='7';
              }
              if(str[i]>='t'&&str[i]<='v')
                {
                  str[i] = '8';
                }
              if(str[i]>='w'&&str[i]<='z')
                {
                  str[i]='9';
                }
        }
    }
    std::cout <<str<< '\n';
  }
  return 0;
}