HDU 2716 Message Decowding

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

水题

View Code
#include <iostream>
using namespace std ;
int main()
{
    char key[27],mes[81] ;
    while(~scanf("%s%*c",key))
    {
        gets(mes) ;
        for(int i=0;mes[i];i++)
        {
            if(mes[i]>='A'&&mes[i]<='Z')
                putchar(key[mes[i]+32-'a']-32);
            else if(mes[i]==' ')
                putchar(' ');
            else
                putchar(key[mes[i]-'a']);
        }
        putchar('\n');
    }
    return 0;
} 
原文地址:https://www.cnblogs.com/xiaohongmao/p/2528127.html