poj2141

简单题

View Code
#include <iostream>
#include
<cstdio>
#include
<cstdlib>
#include
<cstring>
using namespace std;

char f[30];
char st[100];

int main()
{
//freopen("t.txt", "r", stdin);
gets(f);
gets(st);
for (int i = 0; i < strlen(st); i++)
{
if (st[i] <='Z' && st[i] >= 'A')
printf(
"%c",f[st[i] - 'A'] - 'a' + 'A');
else if (st[i] <='z' && st[i] >= 'a')
printf(
"%c", f[st[i] - 'a']);
else
printf(
"%c", st[i]);
}
printf(
"\n");
return 0;
}

posted @ 2011-06-02 11:43  金海峰  阅读(180)  评论(0编辑  收藏  举报