http://acm.hdu.edu.cn/showproblem.php?pid=2140

按题意翻译字符串

View Code
#include <stdio.h>
#include <string.h>
int main()
{
    char tab[10][2]={{'b',' '},{'q',','},{'t','!'},{'m','l'},{'i','e'},{'c','a'},{'a','c'},{'e','i'},{'l','m'}};
    char s[11000];
    int len,i,j;
    while(~scanf("%s",s))
    {
        len=strlen(s);
        for(i=0;i<len;i++)
        {
            for(j=0;j<9;j++)
                if(s[i]==tab[j][0])
                {
                    printf("%c",tab[j][1]);
                    break;
                }
            if(j==9)
                printf("%c",s[i]);
        }
        putchar('\n');
    }
    return 0;
}

 

相关文章:

  • 2021-08-21
  • 2022-12-23
  • 2022-01-09
  • 2021-11-08
  • 2021-12-07
  • 2022-02-18
  • 2021-07-07
猜你喜欢
  • 2022-12-23
  • 2021-10-29
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-10-16
相关资源
相似解决方案